Wobei es etwas missverständlich ist, die "byte_t" zu nennen, weil ja insgesamt 16 Bits drinne sind.Zitat von bL1nK
Code:#include <inttypes.h> typdef union { uint8_t asByte[2]; uint16_t asWord; } data16_t; data16_t variable; variable.asWord = 0x1234; variable.asByte[0] = 0x34; variable.asByte[1] = 0x12;Das ist architekturabhängig, s.g. Endianess. Für AVR (bzw. avr-gcc) ist das der Fall. Wenn man also Kommunikation macht, muss man da schon aufpassen.Zitat von bL1nK
Lesezeichen