show the time on a LED strip
More...
Go to the source code of this file.
|
int | _write (int file, char *ptr, int len) |
| default printf output
|
|
char * | b2s (uint32_t binary, uint8_t rjust) |
| get binary representation of a number More...
|
|
static void | clock_clear (void) |
| switch off all clock LEDs More...
|
|
static void | clock_show_time (uint32_t time) |
| show time on LED clock More...
|
|
static void | clock_leds_set (void) |
| set the LEDs More...
|
|
static void | clock_set_time (uint32_t time) |
| set the time on the LEDs More...
|
|
static void | clock_animate_time (uint32_t time) |
| incrementally set the time on the LEDs More...
|
|
static void | clock_hours (void) |
| show animation with fading hours mark on clock LEDs
|
|
static void | process_command (char *str) |
| process user command More...
|
|
int | main (void) |
| program entry point this is the firmware function started by the micro-controller
|
|
void | rtc_isr (void) |
| interrupt service routine called when tick passed on RTC
|
|
void | adc1_2_isr (void) |
| interrupt service routine called when ADC conversion completed
|
|
show the time on a LED strip
- Author
- King Kévin kingk.nosp@m.evin.nosp@m.@cuvo.nosp@m.odoo.nosp@m..info
- Date
- 2016
Definition in file main.c.
#define BRIGHTNESS_FACTOR 0.1 |
the factor to change the brightness
Definition at line 111 of file main.c.
#define BRIGHTNESS_MAX 1.0 |
maximum LED brightness
Definition at line 109 of file main.c.
#define BRIGHTNESS_MIN 0.2 |
minimum LED brightness
Definition at line 107 of file main.c.
#define PHOTORESISTOR_MAX 1.7 |
photo-resistor voltage for the maximum brightness
Definition at line 103 of file main.c.
#define PHOTORESISTOR_MIN 2.7 |
photo-resistor voltage for the minimum brightness
Definition at line 101 of file main.c.
char* b2s |
( |
uint32_t |
binary, |
|
|
uint8_t |
rjust |
|
) |
| |
get binary representation of a number
- Parameters
-
[in] | binary | number to represent in binary |
[in] | rjust | justify representation with leading zeros |
- Returns
- string with binary representation of the number
Definition at line 132 of file main.c.
static void clock_animate_time |
( |
uint32_t |
time | ) |
|
|
static |
incrementally set the time on the LEDs
this will have an animation where time is incremented until it reaches the provided time
- Parameters
-
Definition at line 268 of file main.c.
static void clock_clear |
( |
void |
| ) |
|
|
static |
switch off all clock LEDs
- Note
- LEDs need to be set separately
Definition at line 157 of file main.c.
static void clock_leds_set |
( |
void |
| ) |
|
|
static |
set the LEDs
set the LED colors on WS2812b LEDs
- Note
- WS2812b LED color values need to be transmitted separately
Definition at line 247 of file main.c.
static void clock_set_time |
( |
uint32_t |
time | ) |
|
|
static |
set the time on the LEDs
- Parameters
-
Definition at line 257 of file main.c.
static void clock_show_time |
( |
uint32_t |
time | ) |
|
|
static |
show time on LED clock
- Parameters
-
show hours and minutes progress as full arcs, show second position as marker. the brightness of the LED shows the progress of the unit. hours are blue, minutes green, seconds red
- Note
- LEDs need to be set separately
Definition at line 170 of file main.c.
static void process_command |
( |
char * |
str | ) |
|
|
static |
process user command
- Parameters
-
[in] | str | user command string (\0 ended) |
Definition at line 313 of file main.c.
float clock_brightness = 1 |
factor to dim LED of the clock, depending on the ambient luminosity
Definition at line 105 of file main.c.
RGB values for the WS2812b clock LEDs
Definition at line 91 of file main.c.
user input command
Definition at line 93 of file main.c.
user input command index
Definition at line 95 of file main.c.
uint8_t gamma_correction_lut[256] = {0} |
gamma correction lookup table (common for all colors)
Definition at line 97 of file main.c.
volatile uint16_t photoresistor_value = 0 |
photo-resistor measurement of ambient luminosity
Definition at line 99 of file main.c.