Clock working, I2C communication to be proven
This commit is contained in:
@@ -10,6 +10,17 @@
|
||||
#include "ws2812_drv.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef struct {
|
||||
uint8_t r;
|
||||
uint8_t g;
|
||||
uint8_t b;
|
||||
} colour_s;
|
||||
|
||||
static colour_s colour_hours = {250, 0, 0};
|
||||
static colour_s colour_minutes = {0, 250, 0};
|
||||
static colour_s colour_seconds = {0, 0, 250};
|
||||
|
||||
|
||||
void ws_Effect_RoudTheClock(void){
|
||||
|
||||
#define RAND_MAX 25
|
||||
@@ -46,6 +57,26 @@ void ws_Effect_RandRound(void){
|
||||
}
|
||||
}
|
||||
|
||||
void ws_effect_display_time(uint8_t hour, uint8_t minute, uint8_t second){
|
||||
|
||||
ws2812_reset();
|
||||
|
||||
ws2812_set_colour(hour, colour_hours.r, colour_hours.g, colour_hours.b);
|
||||
ws2812_update();
|
||||
ws2812_set_colour(minute, colour_minutes.r, colour_minutes.g, colour_minutes.b);
|
||||
ws2812_update();
|
||||
ws2812_set_colour(second, colour_seconds.r, colour_seconds.g, colour_seconds.b);
|
||||
ws2812_update();
|
||||
|
||||
}
|
||||
|
||||
void ws_effect_display_hour(uint8_t hour){
|
||||
|
||||
ws2812_reset();
|
||||
|
||||
ws2812_set_colour(hour, colour_hours.r, colour_hours.g, colour_hours.b);
|
||||
}
|
||||
|
||||
|
||||
void ws_Effect_RandRand(void){
|
||||
|
||||
|
||||
Reference in New Issue
Block a user