/* * Etch-a-Sketch * * A simple program to read two potentiometers connected to analog 0 and 1, interpret them as an ordered pair (x,y) * and send them via serial to the computer * * based on Graph: http://www.arduino.cc/en/Tutorial/Graph */ #include int xCoord; int yCoord; char coords[10]; void setup() { Serial.begin(9600); } void loop() { xCoord = analogRead(0); yCoord = analogRead(1); sprintf(coords, "%d,%d", xCoord, yCoord); Serial.println(coords); delay(50); }