This is a simple voltmeter that takes A0 as an input, the Pin 13 LED blinks everytime a value is sent
/*************************************** * Simple Arduino Voltmeter * Measures Voltage on A0 analog input * CC-BY-NC-SA sonline.neocities.org * 2014-11-29 Ver.: 0.1 ****************************************/ #define ANAIN A0 int vout; void setup() { Serial.begin(9600); pinMode(ANAIN, INPUT); pinMode(13, OUTPUT); } void loop() { while (Serial.available() > 0) { vout = (analogRead(ANAIN) * 5.0) / 1024.0; if(Serial.println(vout)){ digitalWrite(13, HIGH); digitalWrite(13, LOW); } } } |