Skip to content

Commit

Permalink
don't invert analog out value
Browse files Browse the repository at this point in the history
  • Loading branch information
toddtreece committed Feb 16, 2017
1 parent 2ee1be5 commit 6875488
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

/************************ Example Starts Here *******************************/

// digital pin 5
// this should correspond to a pin with PWM capability
#define LED_PIN 5

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

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

Serial.print("received <- ");
Serial.println(reading);
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Adafruit IO Arduino
version=2.3.0
version=2.3.1
author=Adafruit
maintainer=Adafruit <info@adafruit.com>
sentence=Arduino library to access Adafruit IO.
Expand Down
2 changes: 1 addition & 1 deletion src/AdafruitIO_Definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#define ADAFRUITIO_VERSION_MAJOR 2
#define ADAFRUITIO_VERSION_MINOR 3
#define ADAFRUITIO_VERSION_PATCH 0
#define ADAFRUITIO_VERSION_PATCH 1

// forward declaration
class AdafruitIO_Data;
Expand Down

0 comments on commit 6875488

Please sign in to comment.