Boxanzahl korrigiert, Serial-Timeout eingefügt

This commit is contained in:
starcalc 2018-01-10 00:20:28 +01:00
parent 04362e9fb3
commit 8ade0b06f2
2 changed files with 10 additions and 6 deletions

View File

@ -515,13 +515,10 @@ void NeoPatterns::RadarUpdate()
if (angulardistance<0){
angulardistance+=32;
}
}
if (angulardistance<=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) );
}
@ -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++) {
// setPixelColor(i, c);
// }
Serial.println("Coloring Box");
Serial.print("Coloring Box ");
Serial.println(boxid);
setPixelColor(boxs[boxid].left, c);
setPixelColor(boxs[boxid].middle, c);
setPixelColor(boxs[boxid].right, c);

View File

@ -7,7 +7,7 @@
#define PIN D7
// #define BIGPIXELS 20
#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 60
@ -18,7 +18,7 @@ HomieNode homieNode("pixel", "commands");
#define TIMEOUT 500
#define FW_NAME "esp-videoswitcher"
#define FW_VERSION "1.0.2"
#define FW_VERSION "1.0.3"
SoftwareSerial swSer(D2, D1);
int currentnumber = 0;
@ -27,6 +27,7 @@ int commandbytes[4];
String output = "";
String output2 = "";
unsigned long lastMillis = 0;
/*
@ -337,6 +338,7 @@ void loop() {
ArduinoOTA.handle();
while (swSer.available() > 0) {
lastMillis = millis();
int r1 = swSer.read();
Serial.print(currentnumber);
Serial.print(": ");
@ -384,5 +386,9 @@ void loop() {
Serial.print("<");
currentnumber++;
}
if (millis() > lastMillis + 1000)
{
currentnumber = 0;
}
}
}