Step 6Software and User Interface
To set the time first press SW1.
The device will flash all LEDs a few times and then the 10s hours group of LEDs
SW3 will increment the selected group
SW2 will move to the next group of LEDs, each time flashing all LEDs in the group briefly.
The code is written for Sourceboost 'C' compiler version 6.70.
The RTC code is in the t1rtc.c/h files, and has an interrupt function on the T1 timer of the PIC. The T1 timer is set to interrupt every 1 second. On each second, the variable for the time are incremented.
Also a tick timer is counted down every second along with the time. This is used to determine when to transition the display.
The interrupt function also uses the T0 timer interrupt to refresh the display, calling a function in display.c
The files display.h/display.c contain the functions to update the display and show the time
The files control.c/h contain the functions to set the time and read the switches
The files holoclock.c/h are the main loops and initialisation.
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|









































