aboutsummaryrefslogtreecommitdiff
path: root/content/posts/2021-06-26-simple-world-clock.md
diff options
context:
space:
mode:
Diffstat (limited to 'content/posts/2021-06-26-simple-world-clock.md')
-rw-r--r--content/posts/2021-06-26-simple-world-clock.md48
1 files changed, 26 insertions, 22 deletions
diff --git a/content/posts/2021-06-26-simple-world-clock.md b/content/posts/2021-06-26-simple-world-clock.md
index f42af11..ed248dd 100644
--- a/content/posts/2021-06-26-simple-world-clock.md
+++ b/content/posts/2021-06-26-simple-world-clock.md
@@ -5,29 +5,32 @@ date: 2021-06-26T12:00:00+02:00
5draft: false 5draft: false
6--- 6---
7 7
8Our team is spread across the world, from the USA all the way to Australia, 8Our team is spread across the world, from the USA all the way to Australia, so
9so having some sort of world clock makes sense. 9having some sort of world clock makes sense.
10 10
11Currently, I am using an extension for Gnome called 11Currently, I am using an extension for Gnome called [Timezone
12[Timezone extension](https://extensions.gnome.org/extension/2657/timezones-extension/), 12extension](https://extensions.gnome.org/extension/2657/timezones-extension/),
13and it serves the purpose quite well. 13and it serves the purpose quite well.
14 14
15But I also have a bunch of electronics that I bought through the time, and I 15But I also have a bunch of electronics that I bought through the time, and I am
16am not using any of them, and it's time to stop hording this stuff and use it 16not using any of them, and it's time to stop hording this stuff and use it in a
17in a project. 17project.
18 18
19A while ago I bought a small eInk display 19A while ago I bought a small eInk display [Inky
20[Inky pHAT](https://shop.pimoroni.com/products/inky-phat?variant=12549254217811) 20pHAT](https://shop.pimoroni.com/products/inky-phat?variant=12549254217811) and I
21and I have a bunch of [Raspberry Pi's Zero](https://www.raspberrypi.org/products/raspberry-pi-zero/) 21have a bunch of [Raspberry Pi's
22lying around that I really need to use. 22Zero](https://www.raspberrypi.org/products/raspberry-pi-zero/) lying around that
23I really need to use.
23 24
24![Inky pHAT, Raspberry Pi Zero](/assets/world-clock/hardware.jpg) 25![Inky pHAT, Raspberry Pi Zero](/assets/world-clock/hardware.jpg)
25 26
26Since the Inky [Inky pHAT](https://shop.pimoroni.com/products/inky-phat?variant=12549254217811) 27Since the Inky [Inky
27is essentially a HAT, it can easily be added on top of the 28pHAT](https://shop.pimoroni.com/products/inky-phat?variant=12549254217811) is
28[Raspberry Pi Zero](https://www.raspberrypi.org/products/raspberry-pi-zero/). 29essentially a HAT, it can easily be added on top of the [Raspberry Pi
30Zero](https://www.raspberrypi.org/products/raspberry-pi-zero/).
29 31
30First, I installed the necessary software on Raspberry Pi with `pip3 install inky`. 32First, I installed the necessary software on Raspberry Pi with `pip3 install
33inky`.
31 34
32And then I created a file `clock.py` in home directory `/home/pi`. 35And then I created a file `clock.py` in home directory `/home/pi`.
33 36
@@ -76,10 +79,11 @@ board.set_image(img)
76board.show() 79board.show()
77``` 80```
78 81
79And because eInk displays are rather slow to refresh and the clock requires 82And because eInk displays are rather slow to refresh and the clock requires
80refreshing only once a minute, this can be done through cronjob. 83refreshing only once a minute, this can be done through cronjob.
81 84
82Before we add this job to cron we need to make `clock.py` executable with `chmod +x clock.py`. 85Before we add this job to cron we need to make `clock.py` executable with `chmod
86+x clock.py`.
83 87
84Then we add a cronjob with `crontab -e`. 88Then we add a cronjob with `crontab -e`.
85 89
@@ -91,13 +95,13 @@ So, we end up with a result like this.
91 95
92![World Clock](/assets/world-clock/world-clock.jpg) 96![World Clock](/assets/world-clock/world-clock.jpg)
93 97
94And for the enclosure that can be 3D printed, but I haven't yet something like 98And for the enclosure that can be 3D printed, but I haven't yet something like
95this can be used. 99this can be used.
96 100
97<iframe id="vs_iframe" src="https://www.viewstl.com/?embedded&url=https%3A%2F%2Fmitjafelicijan.com%2Fassets%2Fworld-clock%2Fenclosure.stl&color=gray&bgcolor=white&edges=no&orientation=front&noborder=no" style="border:0;margin:0;width:100%;height:400px;"></iframe> 101<iframe id="vs_iframe" src="https://www.viewstl.com/?embedded&url=https%3A%2F%2Fmitjafelicijan.com%2Fassets%2Fworld-clock%2Fenclosure.stl&color=gray&bgcolor=white&edges=no&orientation=front&noborder=no" style="border:0;margin:0;width:100%;height:400px;"></iframe>
98 102
99You can download my [STL file for the enclosure here](/assets/world-clock/enclosure.stl), 103You can download my [STL file for the enclosure
100but make sure that dimensions make sense and also opening for USB port should 104here](/assets/world-clock/enclosure.stl), but make sure that dimensions make
101be added or just use a drill and some hot glue to make it stick in the 105sense and also opening for USB port should be added or just use a drill and some
102enclosure. 106hot glue to make it stick in the enclosure.
103 107