From caa2d9c446f5901671d30e52b1aaa4c56ef2f25c Mon Sep 17 00:00:00 2001 From: Raspberry Pi Date: Wed, 20 Nov 2019 01:22:22 -0600 Subject: Rework directory structure. Modify result file printing to match requirements of web server. --- System/test_Motor.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 System/test_Motor.py (limited to 'System/test_Motor.py') diff --git a/System/test_Motor.py b/System/test_Motor.py new file mode 100644 index 0000000..80cff1e --- /dev/null +++ b/System/test_Motor.py @@ -0,0 +1,23 @@ +from motor import Motor +import time + +# Decide which pins to hook up to on the Pi before running +speed_pin = 17 +forward_pin = 27 +reverse_pin = 22 + +m = Motor(speed_pin, forward_pin, reverse_pin) + +dir = 'ascending' +speed = 0.0 +while 1: + if speed >= 15.0: + dir = 'descending' + elif speed <= -15.0: + dir = 'ascending' + if dir == 'ascending': + speed = speed + 2.0 + else: + speed = speed - 2.0 + m.move(speed) + time.sleep(0.1) \ No newline at end of file -- cgit v1.2.3