diff --git a/blinkenclock.ino b/blinkenclock.ino index fcb4108..5e6a56e 100644 --- a/blinkenclock.ino +++ b/blinkenclock.ino @@ -22,6 +22,7 @@ * Adafruit (NeoPixel Library) * * 07 Nov 2013 - initial release + * 25 Aug 2014 - change the angle remove the mode 2 * * */ @@ -32,7 +33,9 @@ // define something #define LED_PIN 6 // LED strip pin -#define BUTTON_PIN 18 // push button pin number +#define BUTTON_PIN 8 // push button pin number +#define HIGH_PIN_DS1307 A3 // Power supply for DS1307 + Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, LED_PIN, NEO_GRB + NEO_KHZ800); @@ -76,7 +79,10 @@ uint32_t color_ambient; // initialize everything void setup() { + pinMode(HIGH_PIN_DS1307, OUTPUT); + digitalWrite(HIGH_PIN_DS1307, HIGH); Serial.begin(9600); + delay(20); setSyncProvider(RTC.get); setSyncInterval(1); strip.begin(); @@ -87,7 +93,8 @@ void setup() { color_ambient = strip.Color(0, 180, 255); pinMode(A0, INPUT); pinMode(BUTTON_PIN, INPUT); - digitalWrite(BUTTON_PIN, HIGH); + pinMode(BUTTON_PIN, INPUT_PULLUP); + //digitalWrite(BUTTON_PIN, HIGH); delay(20); } @@ -103,6 +110,12 @@ void loop() { if (mode>3) { mode = 0; } + //kille Verbesserung um Mode 2 rauszuschmeiƟen + if (mode==2){ + mode =3; + } + //Kille ende + delay(250); } @@ -198,12 +211,19 @@ void clockMode() { strip.setPixelColor(i,strip.Color(10, 10, 10)); } } - + analoghour=analoghour+30; + if (analoghour>60){ + analoghour=analoghour-60; + } strip.setPixelColor(pixelCheck(analoghour-1),strip.Color(70, 0, 0)); strip.setPixelColor(pixelCheck(analoghour),strip.Color(255, 0, 0)); strip.setPixelColor(pixelCheck(analoghour+1),strip.Color(70, 0, 0)); - - strip.setPixelColor(minute(t),strip.Color(0, 0, 255)); + uint8_t tempminute=minute(t)+30; + if (tempminute>60){ + tempminute=tempminute-60; + } + + strip.setPixelColor(tempminute,strip.Color(0, 0, 255)); if (coptionfade) { // reset counter @@ -214,8 +234,13 @@ void clockMode() { lastsecond = second(); counter = 0; } - strip.setPixelColor(pixelCheck(second(t)+1),strip.Color(0, counter*10, 0)); - strip.setPixelColor(second(t),strip.Color(0, 255-(counter*10), 0)); + uint8_t temsecond=second(t)+30; + if (temsecond>60){ + temsecond=temsecond-60; + } + + strip.setPixelColor(pixelCheck(temsecond+1),strip.Color(0, counter*10, 0)); + strip.setPixelColor(temsecond,strip.Color(0, 255-(counter*10), 0)); counter++; } else {