Python Forum
Web app controlling step by step motors
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Web app controlling step by step motors
#11
There are basic mistake,you try using float value in range(number_of_rotation_1).
number_of_rotation_1 is set to float in line before.
So if route route("/start-admission" even run you should get TypeError.
>>> n = 3
>>> for i in range(n):
...     i
...     
0
1
2
>>> # Make n value float then error
>>> n = float(n)
>>> n
3.0
>>> for i in range(n):
...     i
...     
Traceback (most recent call last):
  File "<string>", line 301, in runcode
  File "<interactive input>", line 1, in <module>
TypeError: 'float' object cannot be interpreted as an integer
Reply
#12
I corrected the float, used int and then instead of range, I used itertools.count(number_of_rotation_1):
No errors now. After run the motors go in full rotation, like a loop or something with no stop.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Next step? oldbean 1 2,064 Apr-05-2020, 06:13 PM
Last Post: keuninkske

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020