Hi,
I am subscribing to around 25 feeds now and I have found that the lines where I do this like:
Adafruit_MQTT_Subscribe onoffbutton = Adafruit_MQTT_Subscribe(&mqtt, AIO_USERNAME "/feeds/onoff");
Take up most of my SRAM. Is there a way around this? Can I store something in PROGMEM instead, like my username?
Thanks,
Aidan
Subscriptions taking up a lot of SRAM
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.
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
- aidan_the_tinkerer
- Posts: 50
- Joined: Fri Nov 01, 2019 2:48 pm
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Subscriptions taking up a lot of SRAM
What microcontroller are you using?
32-bit microcontrollers don’t have a PROGMEM interface, but they do allow you to read and write the Flash array from normal code. Declaring the strings as ‘const’ will keep them out of RAM.
32-bit microcontrollers don’t have a PROGMEM interface, but they do allow you to read and write the Flash array from normal code. Declaring the strings as ‘const’ will keep them out of RAM.
Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.