diff --git a/remote/include/config.h b/remote/include/config.h index b1ac871..848d3b6 100644 --- a/remote/include/config.h +++ b/remote/include/config.h @@ -17,11 +17,11 @@ #include //#define REMOE_OWNER "phschoen" -#define REMOE_OWNER "Marleen" +//#define REMOE_OWNER "Marleen" //#define REMOE_OWNER "Sina" //#define REMOE_OWNER "Malaika" //#define REMOE_OWNER "Pauline" -//#define REMOE_OWNER "Mara" +#define REMOE_OWNER "Mara" #define DEFAULT_BIND_TIME 13 /*seconds*/ diff --git a/remote/include/eeprom.h b/remote/include/eeprom.h index 925aa68..96c6879 100644 --- a/remote/include/eeprom.h +++ b/remote/include/eeprom.h @@ -23,7 +23,7 @@ public: int get_freq_offset(uint8_t* freq_offset); int set_freq_offset(uint8_t freq_offset); private: - #define CURRENT_VERSION 0x02 + #define CURRENT_VERSION 0x01 struct eeprom_data_v1 { uint8_t version; uint32_t data_crc; diff --git a/remote/src/input.cpp b/remote/src/input.cpp index 8cf66e9..1630b9b 100644 --- a/remote/src/input.cpp +++ b/remote/src/input.cpp @@ -91,7 +91,7 @@ void Input::init() { this->ch_config[CH_YAW].inverted = false; this->ch_config[CH_ROLL].inverted = false; this->ch_config[CH_PITCH].inverted = false; - this->ch_config[CH_AUX1].inverted = true; + this->ch_config[CH_AUX1].inverted = false; this->ch_config[CH_AUX2].inverted = true; this->ch_config[CH_AUX3].inverted = true; this->ch_config[CH_AUX4].inverted = true; @@ -226,19 +226,19 @@ void Input::update(void) { } else { this->ch_raw[ch] = digitalRead(this->pins[ch]) == HIGH ? CHANNEL_MIN_100 : CHANNEL_MAX_100; } - - // do inverting - if (this->ch_config[ch].inverted) - this->curr->ch_data[ch] = this->ch_config[ch].max - this->ch_raw[ch]; - else - this->curr->ch_data[ch] = this->ch_raw[ch]; - // cap on max if (this->ch_config[ch].min > this->curr->ch_data[ch]) { this->curr->ch_data[ch] = this->ch_config[ch].min; } else if (this->ch_config[ch].max < this->curr->ch_data[ch]) { this->curr->ch_data[ch] = this->ch_config[ch].max; } + + // do inverting + if (this->ch_config[ch].inverted) + this->curr->ch_data[ch] = map(this->ch_raw[ch], this->ch_config[ch].min, this->ch_config[ch].max, this->ch_config[ch].max, this->ch_config[ch].min); + else + this->curr->ch_data[ch] = this->ch_raw[ch]; + } this->curr->menu = digitalRead(Menu_pin) == HIGH; @@ -265,6 +265,11 @@ void Input::update(void) { } } } + if (this->channel_data[ch] < CHANNEL_MIN_100 ) + this->channel_data[ch] = CHANNEL_MIN_100; + + if (this->channel_data[ch] > CHANNEL_MAX_100 ) + this->channel_data[ch] = CHANNEL_MAX_100; } /* debug_input("t%d y%d r%d p%d \n", */ /* this->channel_data[CH_THROTTLE], */ @@ -272,4 +277,11 @@ void Input::update(void) { /* this->channel_data[CH_ROLL], */ /* this->channel_data[CH_PITCH] */ /* ); */ + int ch = CH_AUX1; + debug_input("raw t%d min %d max %d -> %d\n", + this->ch_raw[ch], + this->ch_config[ch].min, + this->ch_config[ch].max, + this->channel_data[ch] + ); } diff --git a/remote/src/state_init.cpp b/remote/src/state_init.cpp index 3ec5733..405e0f8 100644 --- a/remote/src/state_init.cpp +++ b/remote/src/state_init.cpp @@ -15,7 +15,7 @@ LCD_state_init::LCD_state_init(void) { void LCD_state_init::enter(void) { lcd.clear(); lcd.setCursor(0,0); - lcd.print(" wellcome "); + lcd.print(" welcome "); lcd.setCursor(0,1); lcd_centerText(REMOE_OWNER);