Boxanzahl korrigiert, Serial-Timeout eingefügt
This commit is contained in:
parent
04362e9fb3
commit
8ade0b06f2
|
@ -515,13 +515,10 @@ void NeoPatterns::RadarUpdate()
|
||||||
if (angulardistance<0){
|
if (angulardistance<0){
|
||||||
angulardistance+=32;
|
angulardistance+=32;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (angulardistance<=Radarfadelength){
|
if (angulardistance<=Radarfadelength){
|
||||||
uint8_t _brightness=(Radarfadelength-angulardistance)*255/Radarfadelength;
|
uint8_t _brightness=(Radarfadelength-angulardistance)*255/Radarfadelength;
|
||||||
|
|
||||||
c= Color (int( pow( (_brightness/255.0),2)*255.0), _brightness ,int(pow( (_brightness/255.0),2)*200.0) );
|
c= Color (int( pow( (_brightness/255.0),2)*255.0), _brightness ,int(pow( (_brightness/255.0),2)*200.0) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -575,7 +572,8 @@ void NeoPatterns::colorBox(uint8_t boxid, uint32_t c){ //color a box
|
||||||
// for (int i=boxid*3;i<(boxid+1)*3;i++) {
|
// for (int i=boxid*3;i<(boxid+1)*3;i++) {
|
||||||
// setPixelColor(i, c);
|
// setPixelColor(i, c);
|
||||||
// }
|
// }
|
||||||
Serial.println("Coloring Box");
|
Serial.print("Coloring Box ");
|
||||||
|
Serial.println(boxid);
|
||||||
setPixelColor(boxs[boxid].left, c);
|
setPixelColor(boxs[boxid].left, c);
|
||||||
setPixelColor(boxs[boxid].middle, c);
|
setPixelColor(boxs[boxid].middle, c);
|
||||||
setPixelColor(boxs[boxid].right, c);
|
setPixelColor(boxs[boxid].right, c);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#define PIN D7
|
#define PIN D7
|
||||||
// #define BIGPIXELS 20
|
// #define BIGPIXELS 20
|
||||||
#define NUMPIXELS 70 // 3 LEDs form one pixel
|
#define NUMPIXELS 70 // 3 LEDs form one pixel
|
||||||
#define NUMBOXS 24
|
#define NUMBOXS 25
|
||||||
// #define NUMPIXELS (BIGPIXELS * 3) // 3 LEDs form one pixel
|
// #define NUMPIXELS (BIGPIXELS * 3) // 3 LEDs form one pixel
|
||||||
// #define NUMPIXELS 60
|
// #define NUMPIXELS 60
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ HomieNode homieNode("pixel", "commands");
|
||||||
#define TIMEOUT 500
|
#define TIMEOUT 500
|
||||||
|
|
||||||
#define FW_NAME "esp-videoswitcher"
|
#define FW_NAME "esp-videoswitcher"
|
||||||
#define FW_VERSION "1.0.2"
|
#define FW_VERSION "1.0.3"
|
||||||
|
|
||||||
SoftwareSerial swSer(D2, D1);
|
SoftwareSerial swSer(D2, D1);
|
||||||
int currentnumber = 0;
|
int currentnumber = 0;
|
||||||
|
@ -27,6 +27,7 @@ int commandbytes[4];
|
||||||
String output = "";
|
String output = "";
|
||||||
String output2 = "";
|
String output2 = "";
|
||||||
|
|
||||||
|
unsigned long lastMillis = 0;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -337,6 +338,7 @@ void loop() {
|
||||||
ArduinoOTA.handle();
|
ArduinoOTA.handle();
|
||||||
|
|
||||||
while (swSer.available() > 0) {
|
while (swSer.available() > 0) {
|
||||||
|
lastMillis = millis();
|
||||||
int r1 = swSer.read();
|
int r1 = swSer.read();
|
||||||
Serial.print(currentnumber);
|
Serial.print(currentnumber);
|
||||||
Serial.print(": ");
|
Serial.print(": ");
|
||||||
|
@ -384,5 +386,9 @@ void loop() {
|
||||||
Serial.print("<");
|
Serial.print("<");
|
||||||
currentnumber++;
|
currentnumber++;
|
||||||
}
|
}
|
||||||
|
if (millis() > lastMillis + 1000)
|
||||||
|
{
|
||||||
|
currentnumber = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue