Skip to content

Expose WiFi.setLEDs(r, g, b) through AdafruitIO_AIRLIFT class. #133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 15, 2020

Conversation

ptbw
Copy link
Contributor

@ptbw ptbw commented Aug 13, 2020

The purpose of this change to to allow access to the setLEDs method in the WiFi class used by the Adafruit AirLift module. Making it very simple to add a status light to the class, and allow the visual inspection of the connection.

The change adds a single public method to the AdafruitIO_AIRLIFT class which is only available if included using #define USE_AIRLIFT or similar, so will only be available to specifically including ..IO_AIRLIFT.h

I made a small modification to the AdafruitIO_LEDTest example (supplying a colour from Adafruit.IO):

void handleMessage(AdafruitIO_Data *data) {
  // print RGB values and hex value
  Serial.println("Received HEX: ");
  Serial.println(data->value());
   
  int red = data->toRed();
  int grn = data->toGreen();
  int blu = data->toBlue();
  Serial.println(red);
  Serial.println(grn);
  Serial.println(blu);
  io.setLEDs( red, grn, blu);
}

The example builds when using #define USE_AIRLIFT in the supplied config.h.

@ladyada ladyada requested a review from brentru August 13, 2020 14:03
@brentru
Copy link
Member

brentru commented Aug 14, 2020

@ptbw Thanks for making comments more explicit, I'll test on hardware and merge once it's passing the CI.

This PR is failing our CI build at the Clang step (https://github.com/adafruit/Adafruit_IO_Arduino/pull/133/checks?check_run_id=981225404#step:8:1).

@brentru
Copy link
Member

brentru commented Aug 15, 2020

I made a small modification to the AdafruitIO_LEDTest example (supplying a colour from Adafruit.IO):

@ptbw Do you want to add an example for this into examples? If not everything looks good and I can merge/release

@ptbw
Copy link
Contributor Author

ptbw commented Aug 15, 2020

Go a head and merge, I can't really test any example on anything other than the Airlift feather wing. But I have learnt a lot from this so thank you for your patience.

@brentru brentru merged commit 5b920b2 into adafruit:master Aug 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants