Skip to content

Instantly share code, notes, and snippets.

@miettal
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miettal/a27579cc316bc91edd4b to your computer and use it in GitHub Desktop.
Save miettal/a27579cc316bc91edd4b to your computer and use it in GitHub Desktop.
void setup()
{
Serial.begin(9600);
pinMode(2, OUTPUT);
}
void loop()
{
int aout = analogRead(0);
int dout = digitalRead(2);
Serial.print("AOUT:");
Serial.print(aout/1023.0*5.0);
Serial.println("V");
Serial.print("DOUT:");
Serial.println(dout==HIGH?"HIGH":"LOW");
Serial.println();
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment