I am trying to display the pot value using the serial monitor through xbee. I have one arduino I am reading in the pot value, sending over serial to the second arduino and I want to output the value to the serial monitor. Here is my attempt, I have yet to test it as my partner has the arduinos. Can someone check the code?
arduino1
int potPin = 0; // select input pin
int val = 0; // variable to store the value
void setup() {
Serial.begin(9600);
}
void loop()
{
val = analogRead(potPin); // read the value from the pot
val = map(val, 0 1023, 0, 180);
Serial.println( val );
delay(1);
}