Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [byte-order]

The tag has no usage guidance.

2
votes
2answers
605 views

Problems on convert byte[] to String

I'm reading a RFID Card from RC522 and send the data to my computer. My problem is the conversion of byte[] to String or std::string. #define SIZE_BUFFER 18 #define MAX_SIZE_BLOCK 16 byte ...
1
vote
4answers
1k views

Hex/Byte Reversing and Conversion

I'm working on an RFID system using a MFRC522 with this Library : https://github.com/miguelbalboa/rfid Here's the code I have right now: int A=(mfrc522.uid.uidByte[0]); int B=(mfrc522.uid.uidByte[1]);...
0
votes
3answers
79 views

How to map 6 bytes of raw data to long long type?

I'm trying to solve some problems for a contest, and I have a problem with it. I have to implement a function that has 3 arguments like this: void foo(unsigned char* A, unsigned char* B, unsigned ...
0
votes
3answers
80 views

4 consecutive bytes in buffer to unsigned long

I wonder if there's a smarter way to get these 4 consecutive bytes from a buffer, concatenated in a unsigned long. // the timestamp starts at byte 40 of the received packet and is four bytes, // or ...
1
vote
3answers
304 views

Problem with transmitting 2 byte data in correct way

I'm using Atmel Studio with Atmega328P. I'm trying to send the decimal number 876 continuously from the micro-controller. This was just to learn. To send 876 I need two bytes which is: 0x036C = ...
0
votes
3answers
11k views

How to cast float into four bytes?

I'm trying to save GPS coordinates to an EEPROM. In this example I feed it the latitude of 56060066 as the argument float x void writeFloat(unsigned int addr, float x) { byte seriesOfBytes[3]; *(...
1
vote
1answer
1k views

Using union to return a range of bits from a data frame: wrong approach?

I'm working on an adaptation of Jason Leyrer's Guitar Hero Library for Arduino. My version is for a DJ Hero controller, and I've also borrowed some code from this Arduino forum thread: topic=120527 (...
1
vote
1answer
4k views

Big endian or little endian?

I need to pass a 16-bit long address (for an external EEPROM) to a function (twi_writeTo) in a buffer. I am currently doing this byte buffer[2]; buffer[0] = (byte)(eeaddress >> 8); buffer[1] = (...