Skip to content

Commit 6875488

Browse files
committed
don't invert analog out value
1 parent 2ee1be5 commit 6875488

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

examples/adafruitio_09_analog_out/adafruitio_09_analog_out.ino

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
/************************ Example Starts Here *******************************/
2121

22-
// digital pin 5
2322
// this should correspond to a pin with PWM capability
2423
#define LED_PIN 5
2524

@@ -71,10 +70,8 @@ void loop() {
7170
// the analog feed in the setup() function above.
7271
void handleMessage(AdafruitIO_Data *data) {
7372

74-
// LED gets brighter the darker it is at the sensor
75-
// that means we have to invert the reading
76-
// from 0-1023 back to 1023-0
77-
int reading = 1023 - data->toInt();
73+
// convert the data to integer
74+
int reading = data->toInt();
7875

7976
Serial.print("received <- ");
8077
Serial.println(reading);

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Adafruit IO Arduino
2-
version=2.3.0
2+
version=2.3.1
33
author=Adafruit
44
maintainer=Adafruit <info@adafruit.com>
55
sentence=Arduino library to access Adafruit IO.

src/AdafruitIO_Definitions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#define ADAFRUITIO_VERSION_MAJOR 2
1616
#define ADAFRUITIO_VERSION_MINOR 3
17-
#define ADAFRUITIO_VERSION_PATCH 0
17+
#define ADAFRUITIO_VERSION_PATCH 1
1818

1919
// forward declaration
2020
class AdafruitIO_Data;

0 commit comments

Comments
 (0)