Getting external Current Sensor to work with Speedybee F405

There seems to bee an error in the HAL for Speedybee F405 wing regarding ADC configuration.

# analog pins
PC0 BATT_VOLTAGE_SENS ADC1 SCALE(1)
PC1 BATT_CURRENT_SENS ADC1 SCALE(1)
PC4 RSSI_ADC_PIN      ADC1 SCALE(1)

PC5 PRESSURE_SENS     ADC1 SCALE(1)
define HAL_DEFAULT_AIRSPEED_PIN 15

INAV has PC4 and PC5 switched


// *************** ADC ***************************
#define USE_ADC
#define ADC_INSTANCE                ADC1
#define ADC1_DMA_STREAM             DMA2_Stream0
#define ADC_CHANNEL_1_PIN           PC0
#define ADC_CHANNEL_2_PIN           PC1
#define ADC_CHANNEL_3_PIN           PC5
#define ADC_CHANNEL_4_PIN           PC4
#define VBAT_ADC_CHANNEL            ADC_CHN_1
#define CURRENT_METER_ADC_CHANNEL   ADC_CHN_2
#define RSSI_ADC_CHANNEL            ADC_CHN_3
#define AIRSPEED_ADC_CHANNEL        ADC_CHN_4

I got an analog Airspeed sensor working on the AIRSPD Pad with ARSPD_PIN 14 in the Params, the default 15 didn’t work. Time for a pull request :wink:

But how to count the “pins” in Ardupilot is still a mystery to me.

I am not sure if the problem is deeper. I have seen a post where it was mentionned that Airpspeed and RSSI were switched, but I was not able to get any reading, i.e. I applied voltage, about 2 V to both RSSI pad and Airspeed sensor pin, and then tried out basically all possible pins, especially 14, 15, 24, 25 8,9,10,11. Only the pin 10, voltage was changing RXRSSI indication, i.e, all other pins were indicating zero. Airspeed did not show any indication at all, even when assigning pin 10. And I am pretty sure that the RSSI pad is connected directly to 64 pin processor pin 25, whic h corresonpnnds to something like ADC1_XXXXX_15.