This link has been bookmarked by 2 people . It was first bookmarked on 14 Jun 2007, by York Jong.
-
14 Jun 07
-

-
pseudocode:
- read left_photoresistor
read right_photoresistorif left_photoresistor detects more light than right_photoresistor
then turn robot leftif right_photoresistor detects more light than left_photoresistor
then turn robot rightif right_photoresistor detects about the same as left_photoresistor
then robot goes straightloop
-
Photovore Algorithm, Improved
This algorithm does the same as the original, but instead of case-based it works under a more advanced Fuzzy Logic control algorithm. Your robot will no longer just have the three modes of turn left, turn right, and go forward. Instead will have commands like 'turn left by 10 degrees' or 'turn right really fast', and with no additional lines of code!pseudocode:
- read left_photoresistor
read right_photoresistorleft_motor = (left_photoresistor - right_photoresistor) * arbitrary_constant
right_motor = (right_photoresistor - left_photoresistor) * arbitrary_constantloop
-
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.