Arduino H7 inputs and Betaflight issues. Having output issues

Wanting to take analog inputs from an Arduino and get outputs on beta flight that read 1000 - 2000. Currently have 1.25V centered position of a joystick into an analog. Min and Max positions are 0 - 2.5V respectively. Betaflight at Max and Min positions show ~1180 - 1800 with a center of 1500 (from offset). Here is a line of code exemplifying the issue with the output:

data.ch[PITCH] = map(filteredValues[PITCH] - OFFSET, INPUTMIN, INPUTMAX, OUTPUTMIN, OUTPUTMAX);

Raw data from ADC read for joystick:
MIN POSITION: 0 | CENTER: 420 | MAX POSITON: 810

810 matches with the expectations of 2.5V being its max (2.5/3.1Vref) x 1023 = ~825

things to note:

  • input min/max: 0 - 810
  • output min/max: 1000 - 2000
  • offset: 428
  • Without offset, center shows ~1700-1800

Any suggestions would be great.

Issue: outputs are between 1180 -1800. I want 1000-2000 on betaflight

Question: what am I doing wrong that the output is 1180-1800 on betaflight

What is the issue and what is the question?

Issue: outputs are between 1180 -1800. I want 1000-2000 on betaflight
Question: what am I doing wrong that the output is 1180-1800 on betaflight

What values have You given them?
Posting the entire code would have showed that.

I stated this:
Input min/max are 0 and 810
Output min/max are 1000 2000

Instal a test serial.print showing the analog value. The reading does not swing between 0 and 810.

Which Arduino?

The H7

Raw data value is shown in the post

You miss something and the question is what You missed. Try adjusting the min and max output until You get the swing You want.

IDK what your problem is, but Betaflight has a CLI command rxrange that you can use to map whatever your receiver claims is coming in to whatever range you want Betafloght to use.

rxrange 0 988 2011
rxrange 1 988 2011
rxrange 2 988 2011
rxrange 3 988 2011
save

Like that, but google and read about it.

a7

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.