mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-30 16:24:09 +03:00
Run new astyle formatter against all the examples
This commit is contained in:
@ -1,29 +1,29 @@
|
||||
/*
|
||||
Calibration
|
||||
|
||||
|
||||
Demonstrates one technique for calibrating sensor input. The
|
||||
sensor readings during the first five seconds of the sketch
|
||||
execution define the minimum and maximum of expected values
|
||||
attached to the sensor pin.
|
||||
|
||||
|
||||
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 minimum. Likewise, you set the
|
||||
maximum low and listen for anything higher as the new maximum.
|
||||
|
||||
|
||||
The circuit:
|
||||
* Analog sensor (potentiometer will do) attached to analog input 0
|
||||
* LED attached from digital pin 9 to ground
|
||||
|
||||
|
||||
created 29 Oct 2008
|
||||
By David A Mellis
|
||||
modified 30 Aug 2011
|
||||
By Tom Igoe
|
||||
|
||||
|
||||
http://arduino.cc/en/Tutorial/Calibration
|
||||
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
// These constants won't change:
|
||||
@ -41,7 +41,7 @@ void setup() {
|
||||
pinMode(13, OUTPUT);
|
||||
digitalWrite(13, HIGH);
|
||||
|
||||
// calibrate during the first five seconds
|
||||
// calibrate during the first five seconds
|
||||
while (millis() < 5000) {
|
||||
sensorValue = analogRead(sensorPin);
|
||||
|
||||
|
Reference in New Issue
Block a user