Skip to content

Instantly share code, notes, and snippets.

@nebulak
Created March 27, 2019 12:44
Show Gist options
  • Save nebulak/63038441dbce9ff8fb6afb779090cece to your computer and use it in GitHub Desktop.
Save nebulak/63038441dbce9ff8fb6afb779090cece to your computer and use it in GitHub Desktop.
arduino convert string to/from byte array
void setup(void)
{
}
void loop(void)
{
byte byteArray[5];
strcpy((char *)byteArray,"0123"); //init byte array, index 5 = \0
String myString = String((char *)byteArray);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment