The two photo-sensors are powered by two GPIO pins and read by one ADC on the shared pin. The resulting two ADC values are numbers between 0 and 1023 (10 bit ADC), so basically, if value1 is larger than value2, then I turn the motor clockwise; if value2
↧