Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case EVENTID(BUTTON_POWER, EVENT_THIRD_SAVED_CLICK_SHORT, MODE_OFF):
- // accurate battery level reading every time // BC Added this because....somewhere said it was good?
- srand((rand() * 917823) ^ analogRead(batteryLevelPin));
- // needs this delay
- delay (500);
- ::CommandParser::DoParse("play", "battlevel.wav"); // BC Custom spoken Battery Level
- talkie.Say(spPAUSE1);
- talkie.Say(spPAUSE1);
- talkie.Say(spPAUSE1);
- talkie.Say(spPAUSE1);
- talkie.Say(spPAUSE1);
- talkie.Say(spPAUSE1);
- talkie.Say(spPAUSE1);
- talkie.Say(spPAUSE1);
- talkie.Say(spPAUSE1);
- talkie.SayDigit((int)floorf(battery_monitor.battery()));
- delay (2350);
- ::CommandParser::DoParse("play", "point.wav");
- talkie.Say(spPAUSE1);
- talkie.Say(spPAUSE1);
- talkie.SayDigit(((int)floorf(battery_monitor.battery() * 10)) % 10);
- talkie.SayDigit(((int)floorf(battery_monitor.battery() * 100)) % 10);
- delay (1400);
- ::CommandParser::DoParse("play", "volts.wav");
- return true;
- // ----------------------- Vol menu section --------------------
- void ChangeVolume(bool up) {
- if (up) {
- STDOUT.println("Volume up");
- if (dynamic_mixer.get_volume() < VOLUME) {
- dynamic_mixer.set_volume(std::min<int>(VOLUME + VOLUME * 0.1,
- dynamic_mixer.get_volume() + VOLUME * 0.10));
- //beeper.Beep(0.5, 2000); // BC Custom Spoken Volume menu
- ::CommandParser::DoParse("play", "volchangeup.wav"); // BC Custom Spoken Volume menu
- STDOUT.print("Current Volume: ");
- STDOUT.println(dynamic_mixer.get_volume());
- }
- else {
- //beeper.Beep(0.5, 3000); // BC Custom Spoken Volume menu
- ::CommandParser::DoParse("play", "volmax.wav"); // BC Custom Spoken Volume menu
- }
- } else {
- STDOUT.println("Volume Down");
- if (dynamic_mixer.get_volume() > (0.10 * VOLUME)) {
- dynamic_mixer.set_volume(std::max<int>(VOLUME * 0.1,
- dynamic_mixer.get_volume() - VOLUME * 0.10));
- //beeper.Beep(0.5, 2000); // BC Custom Spoken Volume menu
- ::CommandParser::DoParse("play", "volchangedown.wav");// BC Custom Spoken Volume menu
- STDOUT.print("Current Volume: ");
- STDOUT.println(dynamic_mixer.get_volume());
- }
- else{
- //beeper.Beep(0.5, 1000); // BC Custom Spoken Volume menu
- ::CommandParser::DoParse("play", "volmin.wav"); // BC Custom Spoken Volume menu
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment