Airspeed Indicator code. Equation is needed

I am currently using this airspeed indicator with APM 2.6

I have tried to use the AP_Airspeed example to read the airspeed indicator at A0 pin.

However, it gives me constant 0. It seems the indicator cannot communicate with the APM by AP_Airspeed.

I reloaded the official APM firmware with Mission planner, the airspeed indicator acts normal.

I have also tried to use the AP_AnalogSource example. It actually reads some values. (normally is around 530, if I block either of the pressure input, it goes up or down 50). which means the AnalogSource works fine.

My main question is how to utilize the AnalogSource reading to convert the value to the dynamic pressure. What is the equation converting this relationship?

I went through the airspeed.h. One sentence is max( (Reading - Offset),0 ), where the reading is within [0,1023] and the offset from Mission Planner is about 2100. The result will be always 0. 

Thank you very much for all helps

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…