diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2023-06-27 14:50:20 +0200 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2023-06-27 14:50:20 +0200 |
| commit | 8697555125c57ae64a0c9b78514b4aac4fd523de (patch) | |
| tree | a699df53a7c35a4425f30bca86982c4341f6de40 /content/posts/2021-06-26-simple-world-clock.md | |
| parent | 33b2615a5038bc85036081e8b5e0da8584d88097 (diff) | |
| download | mitjafelicijan.com-8697555125c57ae64a0c9b78514b4aac4fd523de.tar.gz | |
Massive formatting and added figcaption
Diffstat (limited to 'content/posts/2021-06-26-simple-world-clock.md')
| -rw-r--r-- | content/posts/2021-06-26-simple-world-clock.md | 48 |
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 | |||
| 5 | draft: false | 5 | draft: false |
| 6 | --- | 6 | --- |
| 7 | 7 | ||
| 8 | Our team is spread across the world, from the USA all the way to Australia, | 8 | Our team is spread across the world, from the USA all the way to Australia, so |
| 9 | so having some sort of world clock makes sense. | 9 | having some sort of world clock makes sense. |
| 10 | 10 | ||
| 11 | Currently, I am using an extension for Gnome called | 11 | Currently, I am using an extension for Gnome called [Timezone |
| 12 | [Timezone extension](https://extensions.gnome.org/extension/2657/timezones-extension/), | 12 | extension](https://extensions.gnome.org/extension/2657/timezones-extension/), |
| 13 | and it serves the purpose quite well. | 13 | and it serves the purpose quite well. |
| 14 | 14 | ||
| 15 | But I also have a bunch of electronics that I bought through the time, and I | 15 | But I also have a bunch of electronics that I bought through the time, and I am |
| 16 | am not using any of them, and it's time to stop hording this stuff and use it | 16 | not using any of them, and it's time to stop hording this stuff and use it in a |
| 17 | in a project. | 17 | project. |
| 18 | 18 | ||
| 19 | A while ago I bought a small eInk display | 19 | A while ago I bought a small eInk display [Inky |
| 20 | [Inky pHAT](https://shop.pimoroni.com/products/inky-phat?variant=12549254217811) | 20 | pHAT](https://shop.pimoroni.com/products/inky-phat?variant=12549254217811) and I |
| 21 | and I have a bunch of [Raspberry Pi's Zero](https://www.raspberrypi.org/products/raspberry-pi-zero/) | 21 | have a bunch of [Raspberry Pi's |
| 22 | lying around that I really need to use. | 22 | Zero](https://www.raspberrypi.org/products/raspberry-pi-zero/) lying around that |
| 23 | I really need to use. | ||
| 23 | 24 | ||
| 24 |  | 25 |  |
| 25 | 26 | ||
| 26 | Since the Inky [Inky pHAT](https://shop.pimoroni.com/products/inky-phat?variant=12549254217811) | 27 | Since the Inky [Inky |
| 27 | is essentially a HAT, it can easily be added on top of the | 28 | pHAT](https://shop.pimoroni.com/products/inky-phat?variant=12549254217811) is |
| 28 | [Raspberry Pi Zero](https://www.raspberrypi.org/products/raspberry-pi-zero/). | 29 | essentially a HAT, it can easily be added on top of the [Raspberry Pi |
| 30 | Zero](https://www.raspberrypi.org/products/raspberry-pi-zero/). | ||
| 29 | 31 | ||
| 30 | First, I installed the necessary software on Raspberry Pi with `pip3 install inky`. | 32 | First, I installed the necessary software on Raspberry Pi with `pip3 install |
| 33 | inky`. | ||
| 31 | 34 | ||
| 32 | And then I created a file `clock.py` in home directory `/home/pi`. | 35 | And then I created a file `clock.py` in home directory `/home/pi`. |
| 33 | 36 | ||
| @@ -76,10 +79,11 @@ board.set_image(img) | |||
| 76 | board.show() | 79 | board.show() |
| 77 | ``` | 80 | ``` |
| 78 | 81 | ||
| 79 | And because eInk displays are rather slow to refresh and the clock requires | 82 | And because eInk displays are rather slow to refresh and the clock requires |
| 80 | refreshing only once a minute, this can be done through cronjob. | 83 | refreshing only once a minute, this can be done through cronjob. |
| 81 | 84 | ||
| 82 | Before we add this job to cron we need to make `clock.py` executable with `chmod +x clock.py`. | 85 | Before we add this job to cron we need to make `clock.py` executable with `chmod |
| 86 | +x clock.py`. | ||
| 83 | 87 | ||
| 84 | Then we add a cronjob with `crontab -e`. | 88 | Then 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 |  | 96 |  |
| 93 | 97 | ||
| 94 | And for the enclosure that can be 3D printed, but I haven't yet something like | 98 | And for the enclosure that can be 3D printed, but I haven't yet something like |
| 95 | this can be used. | 99 | this 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 | ||
| 99 | You can download my [STL file for the enclosure here](/assets/world-clock/enclosure.stl), | 103 | You can download my [STL file for the enclosure |
| 100 | but make sure that dimensions make sense and also opening for USB port should | 104 | here](/assets/world-clock/enclosure.stl), but make sure that dimensions make |
| 101 | be added or just use a drill and some hot glue to make it stick in the | 105 | sense and also opening for USB port should be added or just use a drill and some |
| 102 | enclosure. | 106 | hot glue to make it stick in the enclosure. |
| 103 | 107 | ||
