From 994e6ba455ecb01400291d11d28f6015eec392aa Mon Sep 17 00:00:00 2001 From: mrbesen Date: Thu, 6 Dec 2018 00:19:00 +0100 Subject: [PATCH] laserclock --- LaserClock/LaserClock.ino | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/LaserClock/LaserClock.ino b/LaserClock/LaserClock.ino index 098e780..be9e70b 100644 --- a/LaserClock/LaserClock.ino +++ b/LaserClock/LaserClock.ino @@ -15,7 +15,9 @@ const unsigned char M[] = {2,3,4,5,6,7}; //how long takes a minute in ms? //const unsigned int mindelay = 60000; -const unsigned int mindelay = 59500; +const unsigned int mindelay = 59000; +//intensity of laser, when "off": 0 -> 0% on; 255 -> 100% on +const unsigned int offtime = 160; //current time unsigned char min = 0; @@ -31,11 +33,11 @@ unsigned long lastmin; void write(unsigned char m = 255, unsigned char h = 255) { //write minutes for(unsigned char i = 0; i < 6; i++) { - analogWrite(M[i], (m & (1 << i)) ? 255 : 1); + analogWrite(M[i], (m & (1 << i)) ? 255 : offtime); } //write hour for(unsigned char i = 0; i < 4; i++) { - analogWrite(H[i], (h & (1 << i)) ? 255 : 4); + analogWrite(H[i], (h & (1 << i)) ? 255 : offtime); } #ifndef nolog //send data to Serial