Arduino Sketch Scaling Analog Data
// Scaling Analog Data
// This sketch is in the public domain
const int analogInPin = A0; // Analog input pin that the potentiometer is attached to
int sensorValue = 0; // value read from the pot
void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
}
void loop() {
// read the analog in value
sensorValue = analogRead(analogInPin);
// send the analog value to MakerPlot
Serial.println(sensorValue); // send analog value
// wait 100 milliseconds before the next loop
delay(100);
}
// This sketch is in the public domain
const int analogInPin = A0; // Analog input pin that the potentiometer is attached to
int sensorValue = 0; // value read from the pot
void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
}
void loop() {
// read the analog in value
sensorValue = analogRead(analogInPin);
// send the analog value to MakerPlot
Serial.println(sensorValue); // send analog value
// wait 100 milliseconds before the next loop
delay(100);
}