I'm attempting to use this Queue library:
So far I'm not having any luck. Here's my stripped down code, based on this example:
#include <cppQueue.h>
typedef struct strRec {
char url[300];
char misc1[255];
} Rec;
Rec tab[2] = {
{ "https://whatever1.com", "something1" },
{ "https://whatever2.com", "something2" }
};
cppQueue queue1(sizeof(Rec), 10, LIFO, true);
void setup() {
Serial.begin(115200);
}
void loop() {
// iterate through the queue
for (int i = 0 ; i < sizeof(tab)/sizeof(Rec) ; i++)
{
Rec rec;
queue1.pop(&rec);
Serial.println("There's something in the queue!");
Serial.println();
Serial.print(rec.url);
Serial.print(" ");
Serial.print(rec.misc1);
Serial.println();
String url = rec.url;
Serial.println("URL = " + url);
Serial.println();
}
delay(1000);
}
However this just prints gibberish to the console:
There's something in the queue!
⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮xV⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮xV⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮xV⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮xV⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮ ,⸮
URL = ⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮
Any ideas by chance?
Also, shouldn't calling pop() on the queue remove that item from the queue? Currently it isn't.