Hello Peter,
Convert LE bytes to integer (C/JAVA): int adc = (((int)low) & 0xff) + ((((int)hi) & 0xff) * 256) Where "low" is the byte at the lower memory address, and hi is the byte at the higher memory address.
Voltage is calculated as: (double)adc / 16.0 * 1.22 / 2047.0 * 11.0;
Temperature is calculated as: (double)adc / 145.0067 * 1.22 - 160.0;
This is driving me nuts :)
With reference
https://social.sbrick.com/wiki/view/pageId/11/slug/the-sbrick-ble-protocol
0F Query ADC
I send 0F00 and read into 2 byte buffer values
0x30 0x48
So dec 48 and 72 -> 48 + ( 72 * 256 ) => 18480
Document notes
The PSU voltage is dropped through a 10:1 voltage divider. VPSU = ADC / 16 * 1.24 / 2047
= 18480 / 16 * 1.24 / 2047
= 0.6996
This value looks wrong.
Measuring with multimeter I get 7.46v .. sbrick iphone app gives 7.43v
Help? Am I doing something incorrectly ?