From 0fdca1683680974533a0cdd4bb08616797704554 Mon Sep 17 00:00:00 2001 From: Lukas Bachschwell Date: Fri, 15 Jul 2016 14:44:33 +0200 Subject: [PATCH] Basic Clock working --- PringlesLooper/PringlesLooper.ino | 33 ++++++++++++++++++------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/PringlesLooper/PringlesLooper.ino b/PringlesLooper/PringlesLooper.ino index aef0b9f..ffef02a 100644 --- a/PringlesLooper/PringlesLooper.ino +++ b/PringlesLooper/PringlesLooper.ino @@ -29,29 +29,34 @@ void tick() { if (time == 24) time = 0; + if (bar == 4) bar = 0; - if ((time == 0) && (bar == 0)) - digitalWrite(13, HIGH); - - if (time == 3) - digitalWrite(13, LOW); + if ((time == 0) && (bar == 0)){ + leds.setPixelColor(0,0,0,255); + leds.setPixelColor(1,0,0,255); + leds.show(); + } + if (time == 3){ + leds.setPixelColor(0,0,0,0); + leds.setPixelColor(1,0,0,0); + leds.show(); + } + if ((time == 0) && (bar != 0)){ + leds.setPixelColor(0,0,255,0); + leds.setPixelColor(1,0,255,0); + leds.show(); + } + if (time == 0) - bar++; - - if ((time == 0) && (bar != 0)) - digitalWrite(12, HIGH); - - if (time == 3) - digitalWrite(12, LOW); - + bar++; time++; - + }