// Example of reading a potentiometer with an analogue pin
// Pin is hooked up to A0 - the same as a Flinduino and Analog shield
// Data is sent to a host PC using a serial interface
// Develop your code in this interface, then copy to your Flinduino and Analog shield
// Do you observe any differences?
int count;
void setup() {
// Communication with a host computer is performed using a serial link
Serial.begin(9600);
}
void loop() {
// print a value to the host via serial
count = 0;
Serial.println(count, DEC);
delay(1000);
}
Hello World
int count;
void setup() {
// Communication with a host computer is performed using a serial link
Serial.begin(9600);
}
Display value
void loop() {
// print a value to the host via serial
count = 99;
Serial.println(count, DEC);
delay(1000);
}
Using potentiometer to test voltage
int count;
void setup() {
// Communication with a host computer is performed using a serial link
Serial.begin(9600);
}
void loop() {
// print a value to the host via serial
count = analogRead(A0);
Serial.println(count);
delay(500);
}
testing voltage sensing pin
int count;
void setup() {
// Communication with a host computer is performed using a serial link
Serial.begin(9600);
}
void loop() {
// print a value to the host via serial
count = analogRead(A1);
Serial.println(count);
delay(500);
}
Table (change to A2 for other)
int count;
void setup() {
// Communication with a host computer is performed using a serial link
Serial.begin(9600);
}
void loop() {
// print a value to the host via serial
count = analogRead(A3);
Serial.println(count);
delay(1000);
}