Skip to content

Instantly share code, notes, and snippets.

@monpetit
Created May 29, 2015 07:47
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 monpetit/9549e4e32ab910fdaa7d to your computer and use it in GitHub Desktop.
Save monpetit/9549e4e32ab910fdaa7d to your computer and use it in GitHub Desktop.
#include <SoftwareSerial.h>
SoftwareSerial Serial(2, 1); // RX, TX
const int analog_pin = A3;
int value;
void setup()
{
Serial.begin(9600);
analogReference(DEFAULT);
}
void loop()
{
value = analogRead(analog_pin);
Serial.print("analog value = ");
Serial.println(value);
delay(1000 - (millis() % 1000));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment