Char, Byte, Array, strings

hi all iam looking for some help

i have this Byte Array and i want to convert it to spell the word "arduino"

byte CharByteArray={97, 114, 100, 117, 105, 110, 111};

can somone help me i gess iam missing one line on code or something more fundamental

the kind of thing iam looking for is the char equivalent of atoi();

thanks for the help

I don't understand what you mean by "spell".
The char bytes are the letters 'a', 'r', 'd', 'u', 'i', 'n', 'o'


Tell the compiler you want to print the contents as characters with a cast.


This example uses a char pointer to loop through an array to print the contents. No need to worry about the length of the string as long as it does not exceed ByteArray-1, when it sees the terminator it knows its reached the end of the string.

byte ByteArray[20];

void setup() {

void loop() {

void example() {
memset(ByteArray,0,sizeof(ByteArray));  //Clean out the contents of ByteArray and initialize all elements to zero

ByteArray[0]=97;   //a
ByteArray[1]=114;  //r
ByteArray[2]=100;  //d
ByteArray[3]=117;  //u
ByteArray[4]=105;  //i
ByteArray[5]=110;  //n
ByteArray[6]=111;  //o
 const char *pointer;
          pointer = ByteArray;   //ByteArray is the address of the first element
    while (*pointer) {           //While the pointer is not a terminator ('\0') then print each element of the ByteArray
          pointer++;             //Increment pointer
 Serial.print('\n');             //Comment this line if you do not need a line feed

hi all thank you all the your help it has allowed me to carry on with my project

If you’re doing it programmatically

strcpy(CharByteArray, “arduino”);

Tell the compiler you want to print the contents as characters with a cast.


Do note that (and some other example here) has a big flaw! The original 'CharByteArray' is not NULL terminated so that will fail with random outcome.