May 30, 2019
I'm working on a project and I need logical operator "or".
I currently have this code, but it's not working...
light_level = 500
if Ed.ReadLeftLightLevel()>light_level or Ed.ReadRightLightLevel()>light_level:
Ed.Drive(Ed.SPIN_LEFT, 30, 200)
Is it possible and there is just a mistake?
February 17, 2019
It should work, except that you didn't indent the 3rd statement. However, be aware that light_level 500 may be very high, and it's a good idea to calibrate at the beginning of your code by reading the ambient light and using a percentage increase/decrease if you are putting the robot in the dark, or using a light to make it brighter.