I am currently trying to convert an integer variable to the value of a static uint8_t array in the Arduino IDE.
I am using:
#include <U8x8lib.h>
And I do understand that uint8_t acts similarly to the byte type.
Currently, the array has a set value:
static uint8_t hello[] = "world";
From my perspective, "world" looks like a string, so I thought I would start with creating a string variable:
String world = "world";
static uint8_t hello[] = world;
This did not work and gave me the error:
initializer fails to determine size of 'hello'
If I do the same, but instead change "world" to an int like below...
int world = 1;
static uint8_t hello[] = world;
I get the same error being:
initializer fails to determine size of 'hello'
I have been successful in converting the uint8_t array to a string through the following process:
static uint8_t hello[] = "world";
String helloconverted = String((const char*)hello);
I don't understand the following:
How a uint8_t array can have a string-like input and work fine, but not when a variable is involved
How to create a string variable as the input for the uint8_t array
How to create a int variable as the input for the uint8_t array
Thanks in advance for your assistance.