Logical operators | EdPy Programming | Forum

Please consider registering

Log In Register

Register | Lost password?
Advanced Search

— Forum Scope —

— Match —

— Forum Options —

Minimum search word length is 3 characters - maximum search word length is 84 characters

Logical operators
May 30, 2019
6:10 pm
New Member
Forum Posts: 1
Member Since:
May 30, 2019
sp_UserOfflineSmall Offline


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?

June 4, 2019
9:23 am
Forum Posts: 4
Member Since:
February 17, 2019
sp_UserOfflineSmall Offline

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. 

  • Keep up with Edison

    Sign up for our newsletter to get all things Edison delivered straight to your inbox.

  • This field is for validation purposes and should be left unchanged.

Heads up

The Australian Federal Parliament has passed a law that extends goods and services tax (GST) to low value imports of physical goods imported by consumers from 1 July 2018.

This means that all customers purchasing Edison robots and accessories with an Australian shipping address must now pay GST. The GST will be automatically added to your purchase and show as a line item on your invoice.

We've detected that you are in Australia, so we wanted to let you know that we have changed your settings to view our Australian site, which displays GST inclusive pricing.

You can change back to the GLOBAL SITE at any time using the link in the top left of the page.

OK got it!    Take me to the GLOBAL SITE instead


Pin It on Pinterest

Share This