Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/libraries/hexbright/hexbright.cpp b/libraries/hexbright/hexbright.cpp
- index 50c7f5f..e96b0e1 100755
- --- a/libraries/hexbright/hexbright.cpp
- +++ b/libraries/hexbright/hexbright.cpp
- @@ -1090,8 +1090,13 @@ int band_gap_reading = 0;
- int lowest_band_gap_reading = 1000;
- void hexbright::read_avr_voltage() {
- - band_gap_reading = read_adc(APIN_BAND_GAP);
- - lowest_band_gap_reading = band_gap_reading < lowest_band_gap_reading ? band_gap_reading : lowest_band_gap_reading;
- + static unsigned char battery_time = 0;
- + if(get_charge_state() == BATTERY) {
- + battery_time++;
- + } else if(battery_time>200) {
- + band_gap_reading = read_adc(APIN_BAND_GAP);
- + lowest_band_gap_reading = band_gap_reading < lowest_band_gap_reading ? band_gap_reading : lowest_band_gap_reading;
- + }
- }
- int hexbright::get_avr_voltage() {
Advertisement
Add Comment
Please, Sign In to add comment