hi experts
i am a noob in arduino programming
i was trying to figure out how to code this to arduino
please helpp
"self.data" is the values from serial data which in hex values
python code:
result = int.from_bytes(self.data[9:11], byteorder='little') / 10.0
skip 9 bytes from serial
take next 3 bytes and arrange them in little endian order
divide the result by 10
i do hope if you could explain it in codes
i dont understand how to code little endian conversion
srnet
5
Always useful to tell the forum as to what the project your doing is;
Why do you want to translate a bit of Python for use in an Arduino .............
westfw
6
2 bytes, since python slices don’t include the upper bound.
Something like:
float Result = (data[9] + (data[10]<<8)) / 10.0;
westfw:
2 bytes, since python slices don’t include the upper bound.
Something like:
float Result = (data[9] + (data[10]<<8)) / 10.0;
excellent, thank you so much