diff options
Diffstat (limited to 'setTime.h')
-rw-r--r-- | setTime.h | 505 |
1 files changed, 0 insertions, 505 deletions
diff --git a/setTime.h b/setTime.h deleted file mode 100644 index b237259..0000000 --- a/setTime.h +++ /dev/null @@ -1,505 +0,0 @@ -/*****************************************************/ -/* Bausatz BIN_Hourglass ver.1.0 *********************/ -/* setTime.h *****************************************/ -/* Pollin Electronic GmbH ****************************/ -/* 85104 Pförring ************************************/ -/* www.pollin.de *************************************/ -/*****************************************************/ -/* Author: Leonhard Hesse ****************************/ -/*****************************************************/ - -#ifndef SETTIME_H_ -#define SETTIME_H_ - -#include <avr/io.h> -#include <util/delay.h> -#include "binTime.h" - -volatile uint8_t hour = 0; -volatile uint8_t minute = 0; -volatile uint8_t second = 0; - -void hourOn() { - PORTD &= ~(1 << PD4); -} -void hourOff() { - PORTD |= (1 << PD4); -} -void minuteOn() { - PORTD &= ~(1 << PD5); -} -void minuteOff() { - PORTD |= (1 << PD5); -} -void secondOn() { - PORTD &= ~(1 << PD6); -} -void secondOff() { - PORTD |= (1 << PD6); -} -void resetTime() { - Time0(); -} -void defaultTime() { - Time255(); -} - -void setHour() { - switch (hour) { - case 0: - Time0(); - break; - case 1: - Time1(); - break; - case 2: - Time2(); - break; - case 3: - Time3(); - break; - case 4: - Time4(); - break; - case 5: - Time5(); - break; - case 6: - Time6(); - break; - case 7: - Time7(); - break; - case 8: - Time8(); - break; - case 9: - Time9(); - break; - case 10: - Time10(); - break; - case 11: - Time11(); - break; - case 12: - Time12(); - break; - case 13: - Time13(); - break; - case 14: - Time14(); - break; - case 15: - Time15(); - break; - case 16: - Time16(); - break; - case 17: - Time17(); - break; - case 18: - Time18(); - break; - case 19: - Time19(); - break; - case 20: - Time20(); - break; - case 21: - Time21(); - break; - case 22: - Time22(); - break; - case 23: - Time23(); - break; - } - if (hour > 23) { - hour = 0; - } -} - -void setMinute() { - switch (minute) { - case 0: - Time0(); - break; - case 1: - Time1(); - break; - case 2: - Time2(); - break; - case 3: - Time3(); - break; - case 4: - Time4(); - break; - case 5: - Time5(); - break; - case 6: - Time6(); - break; - case 7: - Time7(); - break; - case 8: - Time8(); - break; - case 9: - Time9(); - break; - case 10: - Time10(); - break; - case 11: - Time11(); - break; - case 12: - Time12(); - break; - case 13: - Time13(); - break; - case 14: - Time14(); - break; - case 15: - Time15(); - break; - case 16: - Time16(); - break; - case 17: - Time17(); - break; - case 18: - Time18(); - break; - case 19: - Time19(); - break; - case 20: - Time20(); - break; - case 21: - Time21(); - break; - case 22: - Time22(); - break; - case 23: - Time23(); - break; - case 24: - Time24(); - break; - case 25: - Time25(); - break; - case 26: - Time26(); - break; - case 27: - Time27(); - break; - case 28: - Time28(); - break; - case 29: - Time29(); - break; - case 30: - Time30(); - break; - case 31: - Time31(); - break; - case 32: - Time32(); - break; - case 33: - Time33(); - break; - case 34: - Time34(); - break; - case 35: - Time35(); - break; - case 36: - Time36(); - break; - case 37: - Time37(); - break; - case 38: - Time38(); - break; - case 39: - Time39(); - break; - case 40: - Time40(); - break; - case 41: - Time41(); - break; - case 42: - Time42(); - break; - case 43: - Time43(); - break; - case 44: - Time44(); - break; - case 45: - Time45(); - break; - case 46: - Time46(); - break; - case 47: - Time47(); - break; - case 48: - Time48(); - break; - case 49: - Time49(); - break; - case 50: - Time50(); - break; - case 51: - Time51(); - break; - case 52: - Time52(); - break; - case 53: - Time53(); - break; - case 54: - Time54(); - break; - case 55: - Time55(); - break; - case 56: - Time56(); - break; - case 57: - Time57(); - break; - case 58: - Time58(); - break; - case 59: - Time59(); - break; - } - if (minute > 59){ - hour++; - minute = 0; - } -} - -void setSecond() { - switch (second) { - case 0: - Time0(); - break; - case 1: - Time1(); - break; - case 2: - Time2(); - break; - case 3: - Time3(); - break; - case 4: - Time4(); - break; - case 5: - Time5(); - break; - case 6: - Time6(); - break; - case 7: - Time7(); - break; - case 8: - Time8(); - break; - case 9: - Time9(); - break; - case 10: - Time10(); - break; - case 11: - Time11(); - break; - case 12: - Time12(); - break; - case 13: - Time13(); - break; - case 14: - Time14(); - break; - case 15: - Time15(); - break; - case 16: - Time16(); - break; - case 17: - Time17(); - break; - case 18: - Time18(); - break; - case 19: - Time19(); - break; - case 20: - Time20(); - break; - case 21: - Time21(); - break; - case 22: - Time22(); - break; - case 23: - Time23(); - break; - case 24: - Time24(); - break; - case 25: - Time25(); - break; - case 26: - Time26(); - break; - case 27: - Time27(); - break; - case 28: - Time28(); - break; - case 29: - Time29(); - break; - case 30: - Time30(); - break; - case 31: - Time31(); - break; - case 32: - Time32(); - break; - case 33: - Time33(); - break; - case 34: - Time34(); - break; - case 35: - Time35(); - break; - case 36: - Time36(); - break; - case 37: - Time37(); - break; - case 38: - Time38(); - break; - case 39: - Time39(); - break; - case 40: - Time40(); - break; - case 41: - Time41(); - break; - case 42: - Time42(); - break; - case 43: - Time43(); - break; - case 44: - Time44(); - break; - case 45: - Time45(); - break; - case 46: - Time46(); - break; - case 47: - Time47(); - break; - case 48: - Time48(); - break; - case 49: - Time49(); - break; - case 50: - Time50(); - break; - case 51: - Time51(); - break; - case 52: - Time52(); - break; - case 53: - Time53(); - break; - case 54: - Time54(); - break; - case 55: - Time55(); - break; - case 56: - Time56(); - break; - case 57: - Time57(); - break; - case 58: - Time58(); - break; - case 59: - Time59(); - break; - } - if (second > 59){ - minute++; - second = 0; - } -} - -#endif /* SETTIME_H_ */ |