Skip to content

Instantly share code, notes, and snippets.

@komponenrobot
Created May 14, 2019 08:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save komponenrobot/67b4907766614060ffff4ce26f97f5fd to your computer and use it in GitHub Desktop.
Save komponenrobot/67b4907766614060ffff4ce26f97f5fd to your computer and use it in GitHub Desktop.
Konversi 8bit to 16bit
uint16_t data16bit;
uint8_t data8bit[2];
// data8bit[0]
// data bagian atas / HIGH
// data8bit[1]
// data bagian bawah / LOW
data16bit = ((data8bit[0] << 8) & 0xFF00) | data8bit[1];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment