0

Two feeds, program hangs
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

Two feeds, program hangs

by ewhansen on Mon Mar 08, 2021 4:12 pm

I'm working from the adafruitio_02_pubsub example, using an Airlift WiFi shield on an Arduino UNO R3. The basic sketch works, posting the counter value to a dashboard gauge through the "counter" feed. I am trying various modifications.

First, I added a pushbutton for updating the counter. That works as long as I print the state of the button (killing time?) at lines 105-107. Otherwise, the program becomes unresponsive after the first pass through loop().

Simplifying, I removed the counter feed and replaced it with a feed from the button state to an indicator light widget on the dashboard. This works fine, with the print statements at lines 105-107, but it also hangs up without those statements. This is the iteration I have attached.

Finally, putting the counter feed constructor back in (line 50), alongside the button feed, but keeping the remaining references to counter commented out, the program hangs immediately after upload. I don't even get the intro message at line 64.

Grateful for any help figuring this out. Thanks!
Attachments
ButtonFeedTest2.ino
(4.31 KiB) Downloaded 3 times

ewhansen
 
Posts: 30
Joined: Tue Feb 12, 2019 3:18 pm

Re: Two feeds, program hangs

by brubell on Mon Mar 15, 2021 10:52 am

Could you copy and paste the loop in [code] tags instead of attaching it. I'll take a look?

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

Please be positive and constructive with your questions and comments.