Advertisement
NoSloppy

Revo Low Batt tiers

Sep 16th, 2021 (edited)
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1.  
  2. bool low_batt_a_ = false; // BC REVO BATT LEVELS
  3. bool low_batt_b_ = false; // BC REVO BATT LEVELS
  4. bool low_batt_c_ = false; // BC REVO BATT LEVELS
  5. bool low_batt_d_ = false; // BC REVO BATT LEVELS
  6.  
  7.  
  8.  
  9. void Loop() override {
  10. CallMotion();
  11.  
  12. if (on_pending_ && millis() - on_pending_base_ >= on_pending_delay_) {
  13. on_pending_ = false;
  14. SaberBase::TurnOn();
  15. }
  16. if (clash_pending1_) {
  17. clash_pending1_ = false;
  18. Clash(pending_clash_is_stab1_, pending_clash_strength1_);
  19. }
  20. if (clash_pending_ && millis() - last_clash_ >= clash_timeout_) {
  21. clash_pending_ = false;
  22. Clash2(pending_clash_is_stab_, pending_clash_strength_);
  23. }
  24. CheckLowBattery();
  25. #ifdef LOW_BATT_TIERED_WARNINGS
  26. if (battery_monitor.battery() < 3.25 && (!low_batt_a_)){
  27. ::CommandParser::DoParse("play", "lowbatt1.wav");
  28. low_batt_a_ = true;
  29. }
  30. if (battery_monitor.battery() < 3.20 && (!low_batt_b_)){
  31. ::CommandParser::DoParse("play", "lowbatt2.wav");
  32. low_batt_b_ = true;
  33. }
  34. if (battery_monitor.battery() < 3.15 && (!low_batt_c_)){
  35. ::CommandParser::DoParse("play", "lowbatt3.wav");
  36. low_batt_c_ = true;
  37. }
  38. if (battery_monitor.battery() < 3.10 && (!low_batt_d_)){
  39. ::CommandParser::DoParse("play", "lowbatt4.wav");
  40. low_batt_d_ = true;
  41. }
  42. #endif
  43. #ifdef ENABLE_AUDIO
  44. if (track_player_ && !track_player_->isPlaying()) {
  45. track_player_.Free();
  46. }
  47. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement