mirror of
https://github.com/Show-maket/IR-protocol.git
synced 2025-06-28 05:09:40 +00:00
Compare commits
3 Commits
main
...
AVR-Point_
Author | SHA1 | Date | |
---|---|---|---|
6c8ff18de0 | |||
3f29b8f596 | |||
b6e181f7b6 |
@ -18,6 +18,8 @@
|
|||||||
#define INFO "IR_FOX TEST"
|
#define INFO "IR_FOX TEST"
|
||||||
#define SERIAL_SPEED 115200
|
#define SERIAL_SPEED 115200
|
||||||
|
|
||||||
|
constexpr uint8_t cmd_for_car = CarCmd::stop_Tmp_H_S; // <<<<<<<<< CMD FOR CAR
|
||||||
|
|
||||||
//////////////// Var /////////////////
|
//////////////// Var /////////////////
|
||||||
|
|
||||||
IR_Decoder decForward(2, 555);
|
IR_Decoder decForward(2, 555);
|
||||||
@ -191,6 +193,9 @@ void setup() {
|
|||||||
bool testLed = false;
|
bool testLed = false;
|
||||||
uint32_t testLed_timer;
|
uint32_t testLed_timer;
|
||||||
|
|
||||||
|
bool responsponse_f = false;
|
||||||
|
uint32_t responsponse_tim;;
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
// digitalToggle(LoopOut);
|
// digitalToggle(LoopOut);
|
||||||
Timer::tick();
|
Timer::tick();
|
||||||
@ -228,7 +233,11 @@ void loop() {
|
|||||||
if(testLed && millis() - testLed_timer > 100){
|
if(testLed && millis() - testLed_timer > 100){
|
||||||
testLed=false;
|
testLed=false;
|
||||||
digitalWrite(12, LOW);
|
digitalWrite(12, LOW);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(responsponse_f && millis() - responsponse_tim > 100) {
|
||||||
|
responsponse_f=false;
|
||||||
|
encForward.sendData(IR_Broadcast, cmd_for_car);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -237,7 +246,6 @@ void loop() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//test
|
//test
|
||||||
void status(IR_Decoder& dec) {
|
void status(IR_Decoder& dec) {
|
||||||
if (dec.gotData.available() && dec.gotData.getAddrFrom() != 42) {
|
if (dec.gotData.available() && dec.gotData.getAddrFrom() != 42) {
|
||||||
@ -246,8 +254,8 @@ void status(IR_Decoder& dec) {
|
|||||||
testLed = true;
|
testLed = true;
|
||||||
testLed_timer = millis();
|
testLed_timer = millis();
|
||||||
|
|
||||||
encForward.sendData(IR_Broadcast, CarCmd::stop); //<<<<<<<<<<<<<<<<<<<<<<<<<<< CMD IS HERE
|
responsponse_f = true;
|
||||||
|
responsponse_tim = testLed_timer;
|
||||||
|
|
||||||
String str;
|
String str;
|
||||||
if (/* dec.gotData.getDataPrt()[1] */1) {
|
if (/* dec.gotData.getDataPrt()[1] */1) {
|
||||||
|
Reference in New Issue
Block a user