I'm adding a temperature probe to my home-made arduino moonlite clone at the moment.
So I'm adding the command handling to the arduino for setting the temp coefficient but running into trouble.
I'm wondering if indi-moonlite really sends the correct data for this command.
Examples of setting driver values and the serial data sent:
I set the temp in the driver to 1.0 and the driver sends `SC02#` over usb
I set the temp in the driver to 1.2 and the driver sends `SC02#` over usb
I set the temp in the driver to 1.5 and the driver sends `SC03#` over usb
I see it doubles the value and then does a bitwise and with 0xFF to get the hex to send.
So I'm wondering, is this correct?
What is the precision of the value that gets sent over the serial bus?
Also, how do I convert the hex back to a double in arduino code?
OK I found the serial documentation indilib.org/media/kunena/attachments/1/H...sSteppermotor107.pdf
Looks like the commands sent are correct but the protocol uses two-digit, signed (2’s complement) hex number.
So I think it can only support int values from -128 to +127. However the driver UI allows entry of decimal values.