Browse Source

Slowing it down to reduce the jitter readings

master
Englebert 4 years ago
parent
commit
7156059f9f
  1. 1
      OpenFlightTX.h
  2. 11
      OpenFlightTX.ino

1
OpenFlightTX.h

@ -16,6 +16,7 @@ uint16_t roll_insert(uint16_t val);
uint16_t pool_insert(uint8_t pool_type, uint16_t val);
void intro(void);
void read_all_voltage(void);
int readYaw(void);
void bluetooth_gamepad(void);
void stick_calibration(void);
void draw_gimbalbox(uint8_t x, uint8_t y);

11
OpenFlightTX.ino

@ -921,10 +921,19 @@ void intro() {
}
}
int readYaw() {
int samples = 0;
for(int i = 0; i < 10; i++) {
samples = samples + analogRead(YAW_PIN);
}
return samples / 10;
}
void read_all_voltage() {
throttle_raw = analogRead(THROTTLE_PIN);
yaw_raw = analogRead(YAW_PIN);
// yaw_raw = readYaw();
pitch_raw = analogRead(PITCH_PIN);
// roll_raw = analogRead(ROLL_PIN);
// Hardcode to increase the value a bit...
@ -1412,7 +1421,7 @@ void update_display(void) {
update_delay = 10;
if(menu_entry_alpha_list[destination_alpha_state.position].name == "RC Controller") {
require_unlock = true;
update_delay = 100;
// update_delay = 100;
rc_controller();
} else if(menu_entry_alpha_list[destination_alpha_state.position].name == "Battery") {
require_unlock = false;

Loading…
Cancel
Save