I wanted to try turning the rotational motion of the motor into a linear motion, so I decided to make my tile similar to an automatic door.
1 2 3 4 5 6 7 8 9 10 11 12 13 | while True: # Read the sensor once per cycle. sensor_level = sensor.value if sensor_level < 53000: print(sensor_level) pwm = 0.6 print("PWM:", pwm) driver.write(0, -pwm) time.sleep(1.2) driver.write(0, pwm) print('here') time.sleep(1.2) driver.write(0,0) |
Leave a Reply
You must be logged in to post a comment.