aboutsummaryrefslogtreecommitdiffstats
path: root/System_Python/test_Motor.py
diff options
context:
space:
mode:
authorRaspberry Pi <pi@umn.edu>2019-10-15 18:46:52 -0500
committerRaspberry Pi <pi@umn.edu>2019-10-15 18:46:52 -0500
commit632729e3396ce834d1201af342cccd7a0dd55c92 (patch)
tree5ee3db98578af0b91fb67f76c14cfbb982be20f3 /System_Python/test_Motor.py
parentUpdated encoder for proper zero setting and offset behavior. Tested system li... (diff)
downloadee4511w-632729e3396ce834d1201af342cccd7a0dd55c92.tar
ee4511w-632729e3396ce834d1201af342cccd7a0dd55c92.tar.gz
ee4511w-632729e3396ce834d1201af342cccd7a0dd55c92.tar.bz2
ee4511w-632729e3396ce834d1201af342cccd7a0dd55c92.tar.lz
ee4511w-632729e3396ce834d1201af342cccd7a0dd55c92.tar.xz
ee4511w-632729e3396ce834d1201af342cccd7a0dd55c92.tar.zst
ee4511w-632729e3396ce834d1201af342cccd7a0dd55c92.zip
Measured linear movement from physical system. Slightly modified test_Motor to test on physical system.
Diffstat (limited to '')
-rw-r--r--System_Python/test_Motor.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/System_Python/test_Motor.py b/System_Python/test_Motor.py
index 99db520..80cff1e 100644
--- a/System_Python/test_Motor.py
+++ b/System_Python/test_Motor.py
@@ -11,13 +11,13 @@ m = Motor(speed_pin, forward_pin, reverse_pin)
dir = 'ascending'
speed = 0.0
while 1:
- m.move(speed)
- if speed >= 100.0:
+ if speed >= 15.0:
dir = 'descending'
- elif speed <= -100.0:
+ elif speed <= -15.0:
dir = 'ascending'
if dir == 'ascending':
- speed = speed + 0.5
+ speed = speed + 2.0
else:
- speed = speed - 0.5
+ speed = speed - 2.0
+ m.move(speed)
time.sleep(0.1) \ No newline at end of file