#include <SoftwareSerial.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
SoftwareSerial mySerial(0, 1); // RX, TX from point of view of chip
int delayval = 30; // delay for half a second
int analogPin = 3; // potentiometer wiper (middle terminal) connected to analog pin 3 -- Physical pin 3
// outside leads to ground and +5V
long int val = 0; // variable to store the value read
void setup()
{
mySerial.begin(9600); // setup serial
}
void loop()
{
val = 0 ;
for (int count = 0; count < 255; ++count){
val = analogRead(analogPin) + val;
}
mySerial.println(val); // debug value
delay(50);
}