1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-08-01 03:47:23 +03:00

Changed analog references to use new A0 through A5 notation

This commit is contained in:
Tom Igoe
2010-09-04 19:47:59 +00:00
parent 5e2f82b742
commit 47d3b65e51
25 changed files with 57 additions and 46 deletions

View File

@ -33,7 +33,7 @@ void setup() {
void loop() {
// send the value of analog input 0:
Serial.println(analogRead(0));
Serial.println(analogRead(A0));
// wait a bit for the analog-to-digital converter
// to stabilize after the last reading:
delay(10);

View File

@ -15,7 +15,7 @@
Created 26 Sept. 2005
by Tom Igoe
Modified 14 April 2009
Modified 4 Sep 2010
by Tom Igoe and Scott Fitzgerald
This example code is in the public domain.
@ -44,7 +44,7 @@ void loop()
// get incoming byte:
inByte = Serial.read();
// read first analog input, divide by 4 to make the range 0-255:
firstSensor = analogRead(0)/4;
firstSensor = analogRead(A0)/4;
// delay 10ms to let the ADC recover:
delay(10);
// read second analog input, divide by 4 to make the range 0-255:

View File

@ -19,7 +19,7 @@
Created 26 Sept. 2005
by Tom Igoe
Modified 14 April 2009
Modified 4 Sep 2010
by Tom Igoe and Scott Fitzgerald
This example code is in the public domain.
@ -48,7 +48,7 @@ void loop()
// get incoming byte:
inByte = Serial.read();
// read first analog input, divide by 4 to make the range 0-255:
firstSensor = analogRead(0)/4;
firstSensor = analogRead(A0)/4;
// delay 10ms to let the ADC recover:
delay(10);
// read second analog input, divide by 4 to make the range 0-255:

View File

@ -10,15 +10,15 @@
created 2 Dec 2006
by David A. Mellis
modified 14 Apr 2009
modified 4 Sep 2010
by Tom Igoe and Scott Fitzgerald
This example code is in the public domain.
*/
const int redPin = 0; // sensor to control red color
const int greenPin = 1; // sensor to control green color
const int bluePin = 2; // sensor to control blue color
const int redPin = A0; // sensor to control red color
const int greenPin = A1; // sensor to control green color
const int bluePin = A2; // sensor to control blue color
void setup()
{