summaryrefslogtreecommitdiffstats
path: root/Smol Watch Project/My Project/main.c
diff options
context:
space:
mode:
authorJoey Castillo <jose.castillo@gmail.com>2021-04-27 23:06:48 -0400
committerJoey Castillo <jose.castillo@gmail.com>2021-04-27 23:06:48 -0400
commit6833b44f50ee596fcc852b2e0ad4ed1559a8e20a (patch)
tree9ac8f0a3c950c5c768cf91ac6ad8658963723ce0 /Smol Watch Project/My Project/main.c
parent46083a416e38abfb1a36984c71118db6a773a710 (diff)
downloadSensor-Watch-6833b44f50ee596fcc852b2e0ad4ed1559a8e20a.tar.gz
Sensor-Watch-6833b44f50ee596fcc852b2e0ad4ed1559a8e20a.tar.bz2
Sensor-Watch-6833b44f50ee596fcc852b2e0ad4ed1559a8e20a.zip
initial work on segment LCD
Diffstat (limited to 'Smol Watch Project/My Project/main.c')
-rw-r--r--Smol Watch Project/My Project/main.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/Smol Watch Project/My Project/main.c b/Smol Watch Project/My Project/main.c
index 27f77317..ede6d12b 100644
--- a/Smol Watch Project/My Project/main.c
+++ b/Smol Watch Project/My Project/main.c
@@ -15,13 +15,18 @@ int main(void)
date_time.time.sec = 0;
watch_init(&watch);
- watch_enable_led();
- watch_enable_date_time();
+
+ watch_enable_led(&watch);
+
+ watch_enable_date_time(&watch);
watch_set_date_time(date_time);
+
watch_enable_digital_output(A0);
gpio_set_pin_level(A0, true);
- watch_enable_i2c();
-
+
+ watch_enable_display(&watch);
+/*
+ watch_enable_i2c(&watch);
uint8_t chipID = 0;
uint8_t ChipIdRegister = 0xD0;
watch_i2c_send(0x77, &ChipIdRegister, 1);
@@ -29,7 +34,7 @@ int main(void)
if (chipID == 0x60) {
watch_set_led_green();
}
-
+*/
uint8_t last = date_time.time.sec;
while (1) {
@@ -37,9 +42,11 @@ int main(void)
if (date_time.time.sec != last) {
last = date_time.time.sec;
if (last % 2 == 0) {
- watch_set_led_red();
+ watch_set_led_color(50, 0);
+ watch_display_string(&watch, watch.main_display, " Hello");
} else {
- watch_set_led_green();
+ watch_set_led_color(0, 50);
+ watch_display_string(&watch, watch.main_display, " there");
}
}
}