[Solved] How to get uint8_t data of uint32_t [closed]


From your code, “™” is exactly what you should expect.

// 0x19999999 - NOTE: you'd need an extra '5' on the end to make it MAX_UNIT. eg. 0xFFFFFFFF
uint32_t number = 429496729; 

uint8_t x1 = (number >> (8*0)) & 0xff; // 0x99
uint8_t x2 = (number >> (8*1)) & 0xff; // 0x99
uint8_t x3 = (number >> (8*2)) & 0xff; // 0x99
uint8_t x4 = (number >> (8*3)) & 0xff; // 0x19

If you go look up the “™” symbol in extended ascii, it maps to 153, eg. 0x99h.

solved How to get uint8_t data of uint32_t [closed]