*/ // Code sample frome Analog Out example in Arduino IDE (Tom Igoe) /*Modifications Dconner June 2016 * Turned Serial to Software serial */ #include // These constants won't change. They're used to give names // to the pins used: const int analogInPin = A2; // Analog input pin that the potentiometer is attached to const int analogOutPin = 2; // Analog output pin that the LED is attached to int sensorValue = 0; // value read from the pot int outputValue = 0; // value output to the PWM (analog out) const int rx=3; const int tx=2; SoftwareSerial mySerial(rx,tx); void setup() { // initialize serial communications at 9600 bps: mySerial.begin(9600); } void loop() { // read the analog in value: sensorValue = analogRead(analogInPin); mySerial.print("out = "); mySerial.println(sensorValue); // wait 2 milliseconds before the next loop // for the analog-to-digital converter to settle // after the last reading: delay(2); }