Photovore, Split Brain Approach
This algorithm works without comparison of photoresistor values.
Instead, just command the right motor based on light from the left sensor, and the left
motor with only data from the right sensor.
You can also get interesting variations by reversing the sensors for a cross-brain algorithm.
pseudocode:
The human brain to an extent takes the split brain approach. Both halves of the brain,
naturally connected by a nerve called the corpus callosum, share information
between each other. But if you sever this nerve (as does happen although rarely for medical
reasons), the brain mostly remains fully functional. People can lead normal lives, despite
their brain being split in half! (seriously, Im not joking)
This means the brain operates
using the split brain approach, although on many occasions there are advantages to share
information (hence the reason for the nerve).
Photophobe
The photophobe robot is a robot that runs away from light instead of chases light.
There are two ways you can do this. The first is simply to reverse the left and right
photoresistors, so that the left sensor is on the right side, and the right sensor is on the
left side. With no changes of code, it will avoid light!
But if you want to do the code method, make this slight change:
pseudocode:
read left_photoresistor
read right_photoresistor
if left_photoresistor detects more light than right_photoresistor
then turn robot right
if right_photoresistor detects more light than left_photoresistor
then turn robot left
if right_photoresistor detects about the same as left_photoresistor
then robot goes straight
loop