I am using Thunkable BLE to interface with an Arduino Nano 33 IoT chip and control a motor. Everything related to sending and receiving information using the BLE blocks is working like a charm. As part of my design, I’d like to receive the motor step position and display this in my Thunkable app.
The problem that I am having is that I am receiving a 4 byte package representing a signed uint32_t integer and I can’t for the life of me figure out how to convert these 4 bytes into a signed int in Thunkable.
The Arduino package being sent is the following:
union {
uint32_t position;
byte packet[4];
} posData;
Written as posCharacteristic.writeValue(posData.packet, 4);
In Thunkable, I can see that I am getting all the bytes (LE) I expect by printing each byte to a label
How can I create the signed integer with these 4 bytes?