0

Trying to do digital output to particle photon from AIO dash
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Trying to do digital output to particle photon from AIO dash

by dwilliamsvancouv on Wed Sep 18, 2019 6:04 pm

My goal is to do the same thing as the Digital Output Basics tutorial, but on a Particle Photon. Ultimately, I want to use the dashboard control for other things besides turning a light on and off, but I'm having trouble porting the function from the ESP chip to a photon. I have had no trouble using the Adafruit IO Particle library to log data to AIO, so I know how to use this library, but it looks like this library won't do all the same things as the AdafruitIO library used with the ESP chip in the tutorial. Am I wrong? I just need a few pointers to get my photon environment set up to see the change in a toggle button feed on the AIO dashboard.

One alternative is to poll the toggle button feed to see the change in button state, but I'd rather not use this inefficient approach.

dwilliamsvancouv
 
Posts: 1
Joined: Thu Dec 07, 2017 5:39 pm

Re: Trying to do digital output to particle photon from AIO

by mikeysklar on Wed Sep 18, 2019 7:17 pm

Would you like to show us the Digital Output code you are having issues with. Also the specific feature of the ESP chip which you want to port to the photon would be helpful.

It might be worth starting with the inefficient approach of polling for a button change for now and fixing as you progress.

mikeysklar
 
Posts: 177
Joined: Mon Aug 01, 2016 8:10 pm

Re: Trying to do digital output to particle photon from AIO

by brubell on Thu Sep 19, 2019 9:37 am

The Adafruit IO Particle library is not created by Adafruit and it seems like this library implements the Adafruit IO HTTP API whereas Adafruit IO Arduino supports both the HTTP API and the MQTT API (this is why it does not need to poll a feed).


An alternative would be looking into using the [url]Adafruit MQTT[/url]https://github.com/adafruit/Adafruit_MQTT_Library library with your particle as it'll be similar to the expected functionality of the Adafruit IO Arduino library.

One alternative is to poll the toggle button feed to see the change in button state

This is the only possible method with Adafruit IO Particle. You could decrease the polling delay in the loop()
Code: Select all | TOGGLE FULL SIZE
FeedData latest = testFeed.receive();
  if (latest.isValid()) {
    Serial.print(F("Received value from feed: ")); Serial.println(latest);
}

brubell
 
Posts: 528
Joined: Fri Jul 17, 2015 10:33 pm

Please be positive and constructive with your questions and comments.