Hello guest, if you read this it means you are not registered. Click here to register in a few simple steps, you will enjoy all features of our Forum.
Bottom Page

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
Quote
#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.
Quote

Top Page

Forum Jump:


Users browsing this thread: 1 Guest(s)