Hi,
In the code below, I create a struct and assign values to the field.
How can assign a char called newidtest to the a field in the struct?
I get the following error:
error: invalid conversion from 'char*' to 'char'
struct messagePacket {
char boardID[3];
char temperature[3];
};
struct messagePacket myPacket;
void setup() {
char idtest;
struct messagePacket myPacket;
Serial.begin(9600);
strcpy(myPacket.boardID, "01");
strcpy(myPacket.temperature, "75");
Serial.print("ID = ");
Serial.println(myPacket.boardID);
newidtest = myPacket.boardID;
Serial.println(newidtest);
}
void loop() {
}
Thanks