CorBee
Well-known member
This thread points to the same kind of issue : https://forum.pjrc.com/threads/46757-Teensy-3-5-with-nRF24L01-only-half-of-the-message-is-correct
So its a matter of defining the variables on both arduino and teensy side properly and unambiguous.
The float on teensy is default 32 bit it seems and the endian coding is the same as in arduino (LSB). So its my guess that this is the only change needed.
So its a matter of defining the variables on both arduino and teensy side properly and unambiguous.
Code:
const uint16_t ID=1;
typedef struct {
uint16_t NodeId; //2 byte integer
float temperature; //4byte float
} PayloadFrame;
static PayloadFrame Out_Payload; //the variable used in sending data
Out_Payload.NodeId=ID;
Out_Payload.temperature=temperature;
radio.write( &Out_Payload, sizeof(Out_Payload) )
The float on teensy is default 32 bit it seems and the endian coding is the same as in arduino (LSB). So its my guess that this is the only change needed.
Last edited: