drawRGBBitmap with data from a server (or API)

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
modemmike
 
Posts: 5
Joined: Tue Jul 19, 2022 7:29 pm

drawRGBBitmap with data from a server (or API)

Post by modemmike »

Has anyone figured out a way to load bitmap data from an external server? I tried many different ways using JSON but wasn't able to figure it out. I would like to be able to dynamically load images from a server (HTTP get) rather than having them hardcoded into the sketch for the Matrix Portal M4.

User avatar
modemmike
 
Posts: 5
Joined: Tue Jul 19, 2022 7:29 pm

Re: drawRGBBitmap with data from a server (or API)

Post by modemmike »

So I've managed to get the image data from a server and store it into a text file via Adafruit_SPIFlash.h but now, how do I drop that data into?

Code: Select all

matrix.drawRGBBitmap(0, 0, MYTEXTFILE, 32, 32);
The text file just contains: 0xa3cb, 0x79e3, 0x79e3, 0x79e3, 0x79e3, 0x79e3, 0x79e3, 0x79e3, 0x79e3, 0x0000, 0x0000, 0x0000 and I already have the image sizes in the variables.

Basically, I'm just trying to display images that can be pulled in dynamically for my own API server. So this is what I was thinking (I'm terrible with C):

Code: Select all

uint16_t imagenumber1 [] PROGMEM = {  MYTEXTFILE  } 
This is the last bit I haven't figured out and I've been working on this for a week LOL, thank you for reading!

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”