Society of Robots - Robot Forum
Electronics => Electronics => Topic started by: cyclopediatechtilon on February 10, 2009, 09:42:50 AM
-
I am building the 50$ robot and i finished everything exept photosensors
can anyone please tell me what the code admin gave on sensors means??
I mean to say what exactly happens between the servo and photoresistor?
-
Its a photovore so if one side senses light, it will go that way.
-
you could also modify it so that it is a photophobe which means that if one side senses light, it will go in the opoosite direction.
-
see where he typed "pseudocode"
-
where exactly does it (whats it?) say pseudocode, MalitK?
-
The photoresistor is sending an analogue value back to the microcontroller. The analog value is proportional to the amount of light that is hitting the photoresistor. The microcontroller then interprets this value and compares the values of the left and right sides. So if the left sensor has a greater value than the right, there is more light on the left side, and therefore you tell the robot to turn left, and vice versa. If they are equal, it goes straight.