Microcounter
2016-09-24, post № 142
MicroPython, programming, Python 3, #micro, #microcontroller, #pyboard
Being a big fan of Python [1], I recently got a MicroPython Board.
MicroPython is a simple to use micro controller which runs Python 3. To put code onto it, you simple mount it as you would do with a USB flash drive, copy your main.py
to it and restart your MicroPython.
As a simple “Hello world.”-program, I wrote this counting script. Every time you press the built-in [2] button, it counts up by one. Using the four built-in LEDs and binary number representation, this counter can count from 𝟢 to 𝟣𝟧 and then wraps back.
Source code: microcounter.py
Extra assets: microcounter_gif-source-00.jpg, microcounter_gif-source-01.jpg, microcounter_gif-source-02.jpg, microcounter_gif-source-03.jpg, microcounter_gif-source-04.jpg, microcounter_gif-source-05.jpg, microcounter_gif-source-06.jpg, microcounter_gif-source-07.jpg, microcounter_gif-source-08.jpg, microcounter_gif-source-09.jpg, microcounter_gif-source-10.jpg, microcounter_gif-source-11.jpg, microcounter_gif-source-12.jpg, microcounter_gif-source-13.jpg, microcounter_gif-source-14.jpg, microcounter_gif-source-15.jpg