diff --git a/schrittmotor.py b/schrittmotor.py deleted file mode 100644 index 857077f..0000000 --- a/schrittmotor.py +++ /dev/null @@ -1,59 +0,0 @@ -import RPi.GPIO as GPIO -import time - -GPIO.setmode(GPIO.BCM) -GPIO.setwarnings(False) -coil_A_1_pin = 12 # pink -coil_A_2_pin = 20 # orange -coil_B_1_pin = 16 # blau -coil_B_2_pin = 21 # gelb -#enable_pin = 7 # Nur bei bestimmten Motoren benoetigt (+Zeile 24 und 30) - -# anpassen, falls andere Sequenz -StepCount = 8 -Seq = list(range(0, StepCount)) -Seq[0] = [1,0,0,0] -Seq[1] = [1,0,1,0] -Seq[2] = [0,0,1,0] -Seq[3] = [0,1,1,0] -Seq[4] = [0,1,0,0] -Seq[5] = [0,1,0,1] -Seq[6] = [0,0,0,1] -Seq[7] = [1,0,0,1] - -#GPIO.setup(enable_pin, GPIO.OUT) -GPIO.setup(coil_A_1_pin, GPIO.OUT) -GPIO.setup(coil_A_2_pin, GPIO.OUT) -GPIO.setup(coil_B_1_pin, GPIO.OUT) -GPIO.setup(coil_B_2_pin, GPIO.OUT) - -#GPIO.output(enable_pin, 1) - -def setStep(w1, w2, w3, w4): - GPIO.output(coil_A_1_pin, w1) - GPIO.output(coil_A_2_pin, w2) - GPIO.output(coil_B_1_pin, w3) - GPIO.output(coil_B_2_pin, w4) - -def forward(delay, steps): - for i in range(steps): - for j in range(StepCount): - setStep(Seq[j][0], Seq[j][1], Seq[j][2], Seq[j][3]) - time.sleep(delay) - -def backwards(delay, steps): - for i in range(steps): - for j in reversed(range(StepCount)): - setStep(Seq[j][0], Seq[j][1], Seq[j][2], Seq[j][3]) - time.sleep(delay) - -if __name__ == '__main__': - while True: - #delay = raw_input("Zeitverzoegerung (ms)?") - delay = 3 - steps = raw_input("Wie viele Schritte vorwaerts? ") - forward(int(delay) / 1000.0, int(steps)) - setStep(0,0,0,0) - steps = raw_input("Wie viele Schritte rueckwaerts? ") - backwards(int(delay) / 1000.0, int(steps)) - setStep(0,0,0,0) diff --git a/src/schrittmotor.py b/src/schrittmotor.py new file mode 100644 index 0000000..97f6330 --- /dev/null +++ b/src/schrittmotor.py @@ -0,0 +1,3 @@ +import RPi.GPIO as GPIO +import time + diff --git a/templates/css/bootstrap.min.css b/static/css/bootstrap.min.css similarity index 100% rename from templates/css/bootstrap.min.css rename to static/css/bootstrap.min.css diff --git a/templates/css/bootstrap.min.css.map b/static/css/bootstrap.min.css.map similarity index 100% rename from templates/css/bootstrap.min.css.map rename to static/css/bootstrap.min.css.map diff --git a/templates/js/bootstrap.min.js b/static/js/bootstrap.min.js similarity index 100% rename from templates/js/bootstrap.min.js rename to static/js/bootstrap.min.js diff --git a/templates/js/bootstrap.min.js.map b/static/js/bootstrap.min.js.map similarity index 100% rename from templates/js/bootstrap.min.js.map rename to static/js/bootstrap.min.js.map diff --git a/templates/main.html b/templates/main.html index fcc2847..4652608 100644 --- a/templates/main.html +++ b/templates/main.html @@ -2,9 +2,9 @@ RPi Web Server - + - +