mirror of
https://github.com/DashyFox/StackSport.git
synced 2025-06-28 05:09:32 +00:00
sound fine
This commit is contained in:
@ -12,7 +12,7 @@
|
||||
#include "Print.h"
|
||||
#include "SimpleTimer.h"
|
||||
#include "Indicator.h"
|
||||
#include "Sound.h"
|
||||
#include "SoundMelody.h"
|
||||
|
||||
#define ballReact_value 10 // время реакции на вылет мяча
|
||||
|
||||
@ -125,6 +125,8 @@ void RobotTick() {
|
||||
currentInfo.mode = ShotMode;
|
||||
}
|
||||
robotStateStop();
|
||||
|
||||
melody(melody_NoBall);
|
||||
led_clear();
|
||||
for (int i = 7; i <= 12; ++i) {
|
||||
led_blink_num(i, 250, 0xFFFF - 1);
|
||||
@ -143,6 +145,7 @@ void RobotTick() {
|
||||
|
||||
if (elapsedTime > currentInfo.startDelay) {
|
||||
currentInfo.state = RUN;
|
||||
// melody(melody_start);
|
||||
shotApply(postDelayShot);
|
||||
|
||||
} else {
|
||||
@ -156,13 +159,16 @@ void RobotTick() {
|
||||
if (ledProgress > 30) {
|
||||
led_progressbar(9, 0, progress);
|
||||
led_progressbar(10, 19, progress);
|
||||
melody(melody_timerClick);
|
||||
} else {
|
||||
led_progressbar(9, 0, 100);
|
||||
led_progressbar(10, 19, 100);
|
||||
melody(melody_start);
|
||||
}
|
||||
print("delay: ");
|
||||
printNumber(progress);
|
||||
print("\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -177,9 +183,11 @@ uint8_t prepareShot(uint8_t number) {
|
||||
currentInfo.mode = ShotMode;
|
||||
currentInfo.shot.shot = shot;
|
||||
currentInfo.shot.indexGlobal = number;
|
||||
melody(melody_OK);
|
||||
return 1;
|
||||
} else {
|
||||
// TODO: sound_ERR(); ledFX_ERR();
|
||||
melody(melody_Error);
|
||||
print("shot not exist\n\n");
|
||||
return 0;
|
||||
}
|
||||
@ -193,9 +201,11 @@ uint8_t prepareProgramm(uint8_t number) {
|
||||
currentInfo.mode = ProgramMode;
|
||||
currentInfo.program.program = program;
|
||||
currentInfo.program.indexGlobal = number;
|
||||
melody(melody_OK);
|
||||
return 1;
|
||||
} else {
|
||||
// TODO: sound_ERR(); ledFX_ERR();
|
||||
melody(melody_Error);
|
||||
print("program not exist\n\n");
|
||||
return 0;
|
||||
}
|
||||
@ -210,9 +220,10 @@ uint8_t prepareMacro(uint8_t number) {
|
||||
currentInfo.mode = MacroMode;
|
||||
currentInfo.macro.macro = macro;
|
||||
currentInfo.macro.indexGlobal = number;
|
||||
|
||||
melody(melody_OK);
|
||||
return 1;
|
||||
} else {
|
||||
melody(melody_Error);
|
||||
print("Macro not exist ");
|
||||
printNumber(number);
|
||||
print("\n");
|
||||
@ -230,6 +241,8 @@ void BallEXT_Handler() {
|
||||
return;
|
||||
}
|
||||
|
||||
melody(melody_Ball_1);
|
||||
|
||||
print("BallDetected ");
|
||||
uint16_t period = ballReact_timer - noBallTimer;
|
||||
printNumber(period);
|
||||
@ -519,6 +532,11 @@ void stopShooting() {
|
||||
if(currentInfo.mode == DebugShot){
|
||||
currentInfo.mode = ShotMode;
|
||||
}
|
||||
|
||||
if(currentInfo.state == RUN){
|
||||
melody(melody_Done);
|
||||
}
|
||||
|
||||
robotStateStop();
|
||||
|
||||
led_clear();
|
||||
|
Reference in New Issue
Block a user