mirror of https://github.com/noisymime/Arduino.git
deleted redundant analog in example and corrected typos in comments for analog examples
This commit is contained in:
parent
addbdd7949
commit
bc2999f00d
|
@ -1,31 +0,0 @@
|
||||||
/*
|
|
||||||
Analog input, serial output
|
|
||||||
|
|
||||||
Reads an analog input pin, prints the results to the serial monitor.
|
|
||||||
|
|
||||||
The circuit:
|
|
||||||
|
|
||||||
* potentiometer connected to analog pin 0.
|
|
||||||
Center pin of the potentiometer goes to the analog pin.
|
|
||||||
side pins of the potentiometer go to +5V and ground
|
|
||||||
|
|
||||||
created over and over again
|
|
||||||
by Tom Igoe and everyone who's ever used Arduino
|
|
||||||
|
|
||||||
This example code is in the public domain. It's practically in the collective unconscious by now too.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
void setup() {
|
|
||||||
Serial.begin(9600);
|
|
||||||
}
|
|
||||||
|
|
||||||
void loop() {
|
|
||||||
// read the analog input into a variable:
|
|
||||||
int analogValue = analogRead(A0);
|
|
||||||
// print the result:
|
|
||||||
Serial.println(analogValue);
|
|
||||||
// wait 10 milliseconds for the analog-to-digital converter
|
|
||||||
// to settle after the last reading:
|
|
||||||
delay(10);
|
|
||||||
}
|
|
|
@ -1,14 +1,14 @@
|
||||||
/*
|
/*
|
||||||
Calibration
|
Calibration
|
||||||
|
|
||||||
Demonstrates one techinque for calibrating sensor input. The
|
Demonstrates one technique for calibrating sensor input. The
|
||||||
sensor readings during the first five seconds of the sketch
|
sensor readings during the first five seconds of the sketch
|
||||||
execution define the minimum and maximum of expected values
|
execution define the minimum and maximum of expected values
|
||||||
attached to the sensor pin.
|
attached to the sensor pin.
|
||||||
|
|
||||||
The sensor minumum and maximum initial values may seem backwards.
|
The sensor minimum and maximum initial values may seem backwards.
|
||||||
Initially, you set the minimum high and listen for anything
|
Initially, you set the minimum high and listen for anything
|
||||||
lower, saving it as the new minumum. Likewise, you set the
|
lower, saving it as the new minimum. Likewise, you set the
|
||||||
maximum low and listen for anything higher as the new maximum.
|
maximum low and listen for anything higher as the new maximum.
|
||||||
|
|
||||||
The circuit:
|
The circuit:
|
||||||
|
|
Loading…
Reference in New Issue