mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-30 16:24:09 +03:00
Changed analog references to use new A0 through A5 notation
This commit is contained in:
@ -12,6 +12,7 @@
|
||||
* LED connected from digital pin 9 to ground
|
||||
|
||||
created 29 Dec. 2008
|
||||
Modified 4 Sep 2010
|
||||
by Tom Igoe
|
||||
|
||||
This example code is in the public domain.
|
||||
@ -20,7 +21,7 @@
|
||||
|
||||
// These constants won't change. They're used to give names
|
||||
// to the pins used:
|
||||
const int analogInPin = 0; // Analog input pin that the potentiometer is attached to
|
||||
const int analogInPin = A0; // Analog input pin that the potentiometer is attached to
|
||||
const int analogOutPin = 9; // Analog output pin that the LED is attached to
|
||||
|
||||
int sensorValue = 0; // value read from the pot
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
void loop() {
|
||||
// read the analog input into a variable:
|
||||
int analogValue = analogRead(0);
|
||||
int analogValue = analogRead(A0);
|
||||
// print the result:
|
||||
Serial.println(analogValue);
|
||||
// wait 10 milliseconds for the analog-to-digital converter
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
|
||||
Created by David Cuartielles
|
||||
Modified 16 Jun 2009
|
||||
Modified 4 Sep 2010
|
||||
By Tom Igoe
|
||||
|
||||
This example code is in the public domain.
|
||||
@ -27,7 +27,7 @@
|
||||
|
||||
*/
|
||||
|
||||
int sensorPin = 0; // select the input pin for the potentiometer
|
||||
int sensorPin = A0; // select the input pin for the potentiometer
|
||||
int ledPin = 13; // select the pin for the LED
|
||||
int sensorValue = 0; // variable to store the value coming from the sensor
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
created 29 Oct 2008
|
||||
By David A Mellis
|
||||
Modified 17 Jun 2009
|
||||
Modified 4 Sep 2010
|
||||
By Tom Igoe
|
||||
|
||||
http://arduino.cc/en/Tutorial/Calibration
|
||||
@ -27,7 +27,7 @@
|
||||
*/
|
||||
|
||||
// These constants won't change:
|
||||
const int sensorPin = 0; // pin that the sensor is attached to
|
||||
const int sensorPin = A0; // pin that the sensor is attached to
|
||||
const int ledPin = 9; // pin that the LED is attached to
|
||||
|
||||
// variables:
|
||||
|
@ -31,7 +31,7 @@ int index = 0; // the index of the current reading
|
||||
int total = 0; // the running total
|
||||
int average = 0; // the average
|
||||
|
||||
int inputPin = 0;
|
||||
int inputPin = A0;
|
||||
|
||||
void setup()
|
||||
{
|
||||
|
Reference in New Issue
Block a user