Hello,
Probably a basic question but why have I "Invalid conversion"?
#define Sys1 "10001"
#define Sys2 "10010"
char Sys;
void loop()
{
Sys=Sys1;
}
Thanks for your help
Hello,
Probably a basic question but why have I "Invalid conversion"?
#define Sys1 "10001"
#define Sys2 "10010"
char Sys;
void loop()
{
Sys=Sys1;
}
Thanks for your help
the char datatype is one byte....
you are trying to stuff in a string literal...
like this?
#define Sys1 B10001 // a binary number in binary syntax
#define Sys2 B10010
char Sys;
void setup()
{
}
void loop()
{
Sys=Sys1;
}
Thanks but I need to pass "10001" like a char, not a like a binary value!
potzli:
Thanks but I need to pass "10001" like a char, not a like a binary value!
but "10001" isn't a char it is a string literal.
thus, your compiler complains when you try to assign it to a variable of type char.
here is an example of a char assignment:
char myChar = 'A';
here is an example of an assignment to a pointer to a char array!!!
#define Sys1 "10001"
#define Sys2 "10010"
char* Sys;
void setup()
{
}
void loop()
{
Sys=Sys1;
}