int RightVal = 0; // variable to store the value readint LeftVal = 0; // variable to store the value read voidsetup()
{
DDRD = DDRD | B11111100; //Data Direction Register for Port D
DDRB = DDRB | B00000011; //Data Direction Register for Port BSerial.begin(9600); // open the serial port at 9600 bps:
}
voidloop()
{
RightVal = analogRead(0); // read the input pin 0
LeftVal = analogRead(1); // read the input pin 1Serial.print("Right Signal = ");
Serial.println(RightVal);
Serial.print("Left Signal = ");
Serial.println(LeftVal);
Serial.println(""); // prints a carriage returndelay(1000);
}