Davx,davx wrote:Hi,
I've made some tests with the original OXS code and cells function doesn't work either...
- In HUB mode, I can see the 3 cells display in the default telemetry screen but the values are wrong.
- In S.Port mode, no cells display on the default screen.
could it be that you where using Analog pin 7 to read one of your voltage?
I found a bug in oxs_arduino.cpp
There is a line
if ( arduinoData.mVoltPin[cntVolt] < 7) {
It must be
if ( arduinoData.mVoltPin[cntVolt] < 8) {
I am still not sure that this is on the only one bug.
Your feedback is welcome.
Edit:
I had a look at your config file.
It seems that you where using pin 0, 1, 2; so the bug about pin 7 does not explain your issue.
But I found perhaps a mistake in your config file.
You have
#define offset_1 0
#define mVoltPerStep_1 ( ARDUINOVCC * 1000.0 / 1023.0 * 1.0 ) // => 1 is the divider factor
#define offset_2 0
#define mVoltPerStep_2 ( ARDUINOVCC * 1000.0 / 1023.0 * 1.0 )
#define offset_3 0
#define mVoltPerStep_3 ( ARDUINOVCC * 1000.0 / 1023.0 * 1.0 )
When you want to measure a 3s lipo you for sure have to use at least 2 dividers (if using Vcc as reference - and 3 if using internal 1.1 Vref). So you had to adapt the divider factors. It can't be 1 for the 3 cases.
Still not sure this is the solution because your said that Voltages where OK.
Did you try to get all 3 voltages individually?
Which values did you got (e.g. 4000, 8000, 12000 mv)
Let me know if this solves the issue.