Esempio n. 1
0
    [0, 0, 1, 0],
    [0, 0, 0, 1],
]

FULL_STEP_SEQUENCE = [
    [1, 1, 0, 0],
    [0, 1, 1, 0],
    [0, 0, 1, 1],
    [1, 0, 0, 1],
]

try:
    steps_made = 0

    pins = [
        GP.getPin31(),
        GP.getPin32(),
        GP.getPin33(),
        GP.getPin34(),
    ]

    for p in pins:
        p.out()

    right = GP.getPin27()
    right.input()
    left = GP.getPin26()
    left.input()
    reset = GP.getPin24()
    reset.input()
Esempio n. 2
0
from GPIOLibrary import GPIOProcessor
import time

GP = GPIOProcessor()

try:
    Pin23 = GP.getPin23()
    Pin23.out()

    Pin25 = GP.getPin25()
    Pin25.out()

    Pin27 = GP.getPin27()
    Pin27.out()

    Pin31 = GP.getPin31()
    Pin31.out()

    print("Pins are set to output")

    for i in range(0, 20):
        if Pin23.getValue() == 1:
            Pin23.low()
            Pin25.high()
        elif Pin25.getValue() == 1:
            Pin25.low()
            Pin27.high()
        elif Pin27.getValue() == 1:
            Pin27.low()
            Pin31.high()
        elif Pin31.getValue() == 1: