mirror of
https://github.com/DashyFox/StackSport.git
synced 2025-06-28 05:09:32 +00:00
indicator
This commit is contained in:
@ -9,9 +9,9 @@
|
||||
#include "pca9685.h"
|
||||
#include "UART3_Handler.h"
|
||||
#include "EEPROM.h"
|
||||
#include "ShiftReg.h"
|
||||
#include "Print.h"
|
||||
#include "SimpleTimer.h"
|
||||
#include "Indicator.h"
|
||||
|
||||
#define ballReact_value 10 // время реакции на вылет мяча
|
||||
|
||||
@ -80,65 +80,20 @@ void Robot_INIT() {
|
||||
initPCA9685();
|
||||
EEPROM_INIT();
|
||||
UART3_START();
|
||||
led_init();
|
||||
|
||||
setPosDefault();
|
||||
Shiftreg[0] = 0x00;
|
||||
Shiftreg[1] = 0x44;
|
||||
Shiftreg[2] = 0x00;
|
||||
SetShiftReg(Shiftreg);
|
||||
HAL_Delay(10);
|
||||
Shiftreg[0] = 0x00;
|
||||
Shiftreg[1] = 0x66;
|
||||
Shiftreg[2] = 0x00;
|
||||
SetShiftReg(Shiftreg);
|
||||
HAL_Delay(10);
|
||||
Shiftreg[0] = 0x00;
|
||||
Shiftreg[1] = 0x77;
|
||||
Shiftreg[2] = 0x00;
|
||||
SetShiftReg(Shiftreg);
|
||||
HAL_Delay(10);
|
||||
Shiftreg[0] = 0x01;
|
||||
Shiftreg[1] = 0x77;
|
||||
Shiftreg[2] = 0x01;
|
||||
SetShiftReg(Shiftreg);
|
||||
HAL_Delay(10);
|
||||
Shiftreg[0] = 0x03;
|
||||
Shiftreg[1] = 0x77;
|
||||
Shiftreg[2] = 0x03;
|
||||
SetShiftReg(Shiftreg);
|
||||
HAL_Delay(10);
|
||||
Shiftreg[0] = 0x07;
|
||||
Shiftreg[1] = 0x77;
|
||||
Shiftreg[2] = 0x07;
|
||||
SetShiftReg(Shiftreg);
|
||||
HAL_Delay(10);
|
||||
Shiftreg[0] = 0x0F;
|
||||
Shiftreg[1] = 0x77;
|
||||
Shiftreg[2] = 0x0F;
|
||||
SetShiftReg(Shiftreg);
|
||||
HAL_Delay(10);
|
||||
Shiftreg[0] = 0x1F;
|
||||
Shiftreg[1] = 0x77;
|
||||
Shiftreg[2] = 0x1F;
|
||||
SetShiftReg(Shiftreg);
|
||||
HAL_Delay(10);
|
||||
Shiftreg[0] = 0x3F;
|
||||
Shiftreg[1] = 0x77;
|
||||
Shiftreg[2] = 0x3F;
|
||||
SetShiftReg(Shiftreg);
|
||||
HAL_Delay(10);
|
||||
Shiftreg[0] = 0x7F;
|
||||
Shiftreg[1] = 0x77;
|
||||
Shiftreg[2] = 0x7F;
|
||||
SetShiftReg(Shiftreg);
|
||||
HAL_Delay(10);
|
||||
Shiftreg[0] = 0x00;
|
||||
Shiftreg[1] = 0x00;
|
||||
Shiftreg[2] = 0x00;
|
||||
SetShiftReg(Shiftreg);
|
||||
HAL_Delay(10);
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
// if ((i&1U)!=1 || i > 4) for test
|
||||
{
|
||||
led_writeMirror(i, 1);
|
||||
HAL_Delay(10);
|
||||
}
|
||||
}
|
||||
led_clear();
|
||||
|
||||
//testing
|
||||
for (int i = 7; i < 13; ++i) {
|
||||
led_blink_num(i, 100, 15);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -149,6 +104,7 @@ void BallEXT() {
|
||||
|
||||
void RobotTick() {
|
||||
BallEXT_Handler();
|
||||
led_tick();
|
||||
|
||||
// No Ball Handler
|
||||
if (currentInfo.state == RUN && millis() - noBallTimer > noBallTimeout) {
|
||||
|
Reference in New Issue
Block a user