I am curious on how to calculate the brightness percentage for the light sensors on Vexcode V5/Python coding. The brightness percentage seems to show up on the brain for the specified analog port but when I try to code the percentage for the light sensor in python, the condition is never met. Please help with tips on how to code the light sensors brightness percentage in Python! Thank you
In the program you are showing, the program says do nothing if one of the constraints are met, and also if you have brightness percent of 10, 11, 40, 41, 95, or 96, the if statement won’t be fulfilled. I’m guessing that you want the program to exit the while True loop when a condition is met, in which case you should replace the pass statements with break statements. Also, you’ll might want to replace > and < with >= and <= so that your program sees the values you accidentally skipped.
I will have other commands that i will want the code to execute once the conditions are met, this is just an examples of the if statement conditions that I am having problems with. I am mainly curious on how to calculate the correct percentage for the light brightness for the sensors so that i can get the conditions to execute properly. Thank you
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.