Skip to content

Commit 8179ad9

Browse files
committed
Test continuous motor feedback
1 parent 5e50fbe commit 8179ad9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/motors.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import time
44
import unittest
55

6-
from buildhat import Motor
6+
from buildhat import Hat, Motor
77
from buildhat.exc import DeviceError, MotorError
88

99

@@ -121,6 +121,15 @@ def test_continuous_position(self):
121121
while time.time() < t:
122122
m.run_to_position(0)
123123

124+
def test_continuous_feedback(self):
125+
"""Test feedback of motor for 30mins"""
126+
Hat(debug=True)
127+
t = time.time() + (60 * 30)
128+
m = Motor('A')
129+
m.start(40)
130+
while time.time() < t:
131+
_ = (m.get_speed(), m.get_position(), m.get_aposition())
132+
124133

125134
if __name__ == '__main__':
126135
unittest.main()

0 commit comments

Comments
 (0)