Converts 16-bit unsigned integer presented as two bytes to a number. A result of the conversion will be between 0.00 and 65535.00.
u16-to-number
@/u16-to-number
Converts 16-bit unsigned integer presented as two bytes to a number. A result of the conversion will be between 0.00 and 65535.00.
node {
void evaluate(Context ctx) {
uint8_t b1 = getValue<input_B1>(ctx);
uint8_t b0 = getValue<input_B0>(ctx);
uint16_t num = ((b1 << 8) | b0);
Number result = (Number)num;
emitValue<output_OUT>(ctx, result);
}
}
B1 | B0 | OUT |
FFh | FFh | 65535.00 |
3Ch | 6Bh | 15467.00 |
00h | 00h | 0.00 |