PyCon JP 2024

ロケール設定が保存されました。pretalxでは英語のサポートが充実していると思っていますが、問題やエラーが発生した場合は、ぜひご連絡ください。

Fun with microcontrollers: Building a digital sundial using Python
2024/09/27 , 4F Track3

Using Python to program physical devices is both possible and fun.

Let’s explore what you can accomplish with just a bit of Python, a microcontroller, and a small display by using them to build a digital sundial that you can carry in your pocket.


The objective of this talk is to show how easy it is to build a Python application which runs on a single board computer. It will walk attendees through the steps of getting a Python application running on a microcontroller that is attached to a small display.

We use a circle drawn on the display to show the sundial broken into its different parts – dawn, daytime, twilight, and night. In order to correctly calculate the boundaries between these parts, we need the local time for solar day events.

For a given latitude-longitude, we can get that data from the sunrise-sunset.org API, the use of which is free (as long as attribution is given). Once we have the details for solar events, we have all the information we need to draw the sundial on the display.

The rest of the presentation shows the implementation of the digital sundial - both the Python code and the hardware.

NOTE: Depending on which ends up working better, the hardware platform used will either be a Raspberry Pi Zero using CPython or an Adafruit Feather M4 Express using CircuitPython.


この題材を選んだ理由やきっかけ

I am interested in using Python to solve everyday problems. Microcontrollers are an inexpensive way to tackle small problems in the physical world. This topic allows me to bring those together in a surprisingly easy way.

オーディエンスが持って帰れる具体的な知識やノウハウ

From this talk, attendees will understand how to get started writing Python applications that run on a computer about the size of their thumb.

オーディエンスに求める前提知識

Basic understanding of Python

オーディエンスの経験レベル

Beginner

発表の言語

English

発表資料の言語

English

See also: Fun With Microcontrollers

Scott Irwin is a senior engineer at Bloomberg, where he has worn many hats. During his decade at Bloomberg, he has led teams, developed Python applications and libraries that are part of the tools used by the company’s clients to discover and use relevant functionality on the Bloomberg Terminal, and taught internal training courses.

Scott is also a Python educator who has led live online training events hosted on the O'Reilly learning platform.