Hello, for a project, I need to create a database in matrix format, in which some strings are stored based on a 4-byte identifier, the database would be like this:
"4bytes" BD_Num[2] = {
0x0011AAEE,
0x2233CCFF
}
"28Chars" BD_Val[2] = {
"hello",
"goodbye"
}
and the operation would be something like this:
1.- I receive an identifier
2.- with a for loop I look for it in BD_Num[]
3.- based on the number that I have obtained, I return the value of BD_Val[]
My problem is space, I have plenty of processing time, I can afford to do that "thing", but I need to be able to limit the volume of data
For the identifier I need 4Bytes, which for example in an arduino uno is a long, but I understand that in an arduino a long is worth 8bytes (I'm not sure), how can I define an unsigned integer of exactly 4bytes?
On the other hand, for the string, I need to limit it to 28 characters maximum, I think it can be done using a char array instead of a normal string, but I don't know how to make it not overflow, any ideas?
I would appreciate any answer