Created
May 24, 2013 07:45
-
-
Save electronut/5641938 to your computer and use it in GitHub Desktop.
Read analog values from A0 and A1 and print them to serial port.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// analog-plot | |
// | |
// Read analog values from A0 and A1 and print them to serial port. | |
// | |
// electronut.in | |
#include "Arduino.h" | |
void setup() | |
{ | |
// initialize serial comms | |
Serial.begin(9600); | |
} | |
void loop() | |
{ | |
// read A0 | |
int val1 = analogRead(0); | |
// read A1 | |
int val2 = analogRead(1); | |
// print to serial | |
Serial.print(val1); | |
Serial.print(" "); | |
Serial.print(val2); | |
Serial.print("\n"); | |
// wait | |
delay(50); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment