diff --git a/60LED_WS2812B_NTP_Clock.ino b/60LED_WS2812B_NTP_Clock.ino index 9c471a7..b2467fe 100644 --- a/60LED_WS2812B_NTP_Clock.ino +++ b/60LED_WS2812B_NTP_Clock.ino @@ -44,7 +44,8 @@ RgbwColor temp; #define MINIMAL_BRIGHTNESS 20 #define LDR_SCALE 16 #define colorSaturation 192 -NeoPixelBrightnessBus strip(NUM_LEDS, DATA_PIN); +//NeoPixelBrightnessBus strip(NUM_LEDS, DATA_PIN); +NeoPixelBrightnessBus strip(NUM_LEDS, DATA_PIN); RgbColor red(colorSaturation, 0, 0); RgbColor green(0, colorSaturation, 0); RgbColor blue(0, 0, colorSaturation); @@ -239,7 +240,7 @@ void syncNTP() { } void setup() { - //interrupt for one second@80Mhz! + //interrupt for one second timer = timerBegin(0, 80, true); timerAttachInterrupt(timer, &onTimer, true); timerAlarmWrite(timer, 1000000, true); @@ -250,9 +251,9 @@ void setup() { Serial.begin(SERIAL_BAUD); Serial.flush(); - Serial.print("CPU Frequency is: "); + Serial.print("\nCPU Frequency is: "); Serial.print(getCpuFrequencyMhz()); //Get CPU clock - Serial.print(" Mhz"); + Serial.println(" Mhz"); strip.Begin(); strip.SetBrightness( MINIMAL_BRIGHTNESS ); @@ -276,8 +277,10 @@ void loop() { // -- doLoop should be called as frequently as possible. iotWebConf.doLoop(); - while (Serial.available()) + /* + while (Serial.available()) Serial.read(); + */ if (!setupDone && interruptCounter > 0) { if (currentSec < 0) { currentSec = 59; @@ -293,9 +296,7 @@ void loop() currentSec--; portEXIT_CRITICAL(&timerMux); } - - while (setupDone && interruptCounter > 0) { - + if (setupDone && interruptCounter > 0) { //brigthness measurement ldrValue = (ldrValue + analogRead(LDR_PIN)); //Serial.println(ldrValue);