Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //*testing code*//
- #include <Time.h>
- #include <TimeLib.h>
- #define latchpin 2
- #define datapin 3
- #define clockpin 4
- byte hours1thr8 = 0;
- int currenthours1thr8 = 0;
- int h, m;
- void setup() {
- pinMode(latchpin,OUTPUT);
- pinMode(datapin,OUTPUT);
- pinMode(clockpin,OUTPUT);
- }
- void loop() {
- h = hours();
- m = minutes();
- {
- if(h <= 20) {
- int remainder = h % 12;
- if(0 < remainder && remainder < 9)
- currenthours1thr8 = remainder - 1;
- }
- }
- {
- bitSet(hours1thr8, currenthours1thr8);
- digitalWrite(latchpin,LOW);
- shiftOut(datapin,clockpin,LSBFIRST,hours1thr8);
- digitalWrite(latchpin,HIGH);
- delay(2000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment