Skip to content

Commit

Permalink
Mode 2 Entfernt und weitere Änderungen
Browse files Browse the repository at this point in the history
  • Loading branch information
kille committed Sep 5, 2014
1 parent a079b1b commit c440ecb
Showing 1 changed file with 32 additions and 7 deletions.
39 changes: 32 additions & 7 deletions blinkenclock.ino
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* Adafruit (NeoPixel Library)
*
* 07 Nov 2013 - initial release
* 25 Aug 2014 - change the angle remove the mode 2
*
* */

Expand All @@ -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);

Expand Down Expand Up @@ -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();
Expand All @@ -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);
}

Expand All @@ -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);
}

Expand Down Expand Up @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit c440ecb

Please sign in to comment.