# Convert byte array to signed int

**URL:** <https://community.thunkable.com/t/convert-byte-array-to-signed-int/3048114>\
**Category:** BLE / BlueTooth\
**Tags:** beginner, help\
**Created:** [June 8, 2024, 10:11am UTC](https://community.thunkable.com/t/convert-byte-array-to-signed-int/3048114 "2024-06-08T10:11:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pingknapp4n](https://avatars.discourse-cdn.com/v4/letter/p/7993a0/32.png) [@pingknapp4n](https://community.thunkable.com/u/pingknapp4n)\
**Post date:** [June 8, 2024, 10:11am UTC](https://community.thunkable.com/t/convert-byte-array-to-signed-int/3048114/1 "2024-06-08T10:11:59Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![matt\_conroy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/matt_conroy/32/150843_2.png) [@matt\_conroy](https://community.thunkable.com/u/matt_conroy)\
**Post date:** [June 14, 2024, 3:25pm UTC](https://community.thunkable.com/t/convert-byte-array-to-signed-int/3048114/2 "2024-06-14T15:25:44Z")

</div>

Hi pingknapp4n, welcome to Thunkable! 🎉

Be sure to check out our posts about [How to ask Great Questions v2.0](https://community.thunkable.com/t/how-to-ask-great-questions-v2-0/2689983/1), our [Community Guidelines](https://community.thunkable.com/t/community-guidelines/78/8), and our [Docs](https://docs.thunkable.com/) as you get started.

Thunkable currently supports [receiving data in String and Byte Array format from BLE devices](https://docs.thunkable.com/blocks/advanced-app-features/bluetooth-low-energy), however we don’t have blocks specifically designed for converting this data. It might be possible, depending on the device(s) and their ability to send this data through String or Byte Array format, however we haven’t tested and verified this so it would require some experimentation
