Kód: Vybrat vše
struct dataStruct{ // Group list of variables under one name in a block of memory
char motor;
float a;
}myData;
byte tx_buf[sizeof(myData)] = {0};
Kód: Vybrat vše
void()
[b]myData.motor="asDF text ktory chcem preniest";[/b] - tuto je najskôr chyba
myData.a= 25.12;
//odoslanie
memcpy(tx_buf, &myData, sizeof(myData) ); // Get data, data size from memory
byte Size = sizeof(myData); // Set Size to length of each piece of data
driver.send((uint8_t *)tx_buf, Size); // Transmit the data
driver.waitPacketSent(); // Wait until the transmitter completes sending
delay(10);
Prosím vás, ak máte čas, pozrieť sa na to..