B4R Question FIFO data structure

demasi

Active Member
Licensed User
Longtime User
Hello,

I need to use a FIFO like queue structure in my arduino program.
This is to store a few short messages received through bluetooth (maximum 10 messages of no more than 30 bytes), and they will be processed and removed from the queue, leaving room for new messages.
I tried with array of bytes but with no success.

Thank you for any help.
 

demasi

Active Member
Licensed User
Longtime User
I searched a lot at the forum, but I couldn't find this.
It seems that this is perfect for my project, exactly what I need.
In a first look, I already learned a lot from your code.
Thank you. Again.. And again.... and again...
 
Upvote 0

demasi

Active Member
Licensed User
Longtime User
As I said in older post, I´m creating a software for my led panel. It will, among other things, show messages from the user's phone. I´m using bluetooth for now, but to avoid the use of another app for mobile, I will use a web server on the arduino mega. I have a version working.
I was facing stability and memory problems, because I was using many timers, and it was having a weird behavior.
So I decided to create a kind of script, to be processed in the loop, showing the time, temperature, pressure (!!!), images, the messages, and this queue was a much needed feature.
My first attept to create this queue was a disaster. I don't know why, but my background processing and the timers and arrays was interfering with the led display memory, and weird things was happening until the arduino freezes completely.
I changed all the logic, and now the code is easy, clean, easy to understand. Your code will helpo too much this approach.
I have a short deadline due to the events dates being near.
Thank you again.
 
Upvote 0
Top