Tag Python

Tag Python RSS 2.0 Feed

Light up WS2811 LEDs with a Raspberry Pi 5 via SPI

A few weeks ago I bought 300 addressable LEDs. To be more precise, 6 x 50 12V WS2811 with a spacing of 25 cm each. Also known as NeoPixel. I wanted to control these LEDs with a Raspberry Pi. So I bought the latest model, Raspberry Pi 5 with 8GB RAM.

WS2811 LEDs by Raspberry Pi 5 SPI

After I had set up my Raspberry Pi, I wanted to follow the tutorial NeoPixels on Raspberry Pi by Tony DiCola to carry out a first test with the LEDs. I had already done the wiring as described under Using External Power Source Without Level Shifting. But then I read the following information in the next item Python Installation of NeoPixel Library.

The next line then said that you should watch the tutorial CircuitPython NeoPixel Library Using SPI. With the help of the Adafruit_CircuitPython_NeoPixel_SPI library, an LED ring is controlled via an FT233H. I would like to show how I did this with a Raspberry Pi 5.

Continue reading ...

Temporary Apache development web server in a Docker container

From time to time I need to run a temporary web server on my local operating system. In the most cases only for the some frontend development of small projects or some prove of concept. Installing nginx or Apache is no option.

Continue reading ...

Inaccurate rounding with decimal digits

I made a small post about Inexact rounding up or down with decimal digits. But it is also possible to run into the same bug when rounding floating point numbers to the next number with restricted decimal digits. A really common example is the price calculation. You have the price 1.99 for example and the tax is maybe 19%. The resulting price with tax would be 2.3681. So you will need to round the price with two decimal digits to 2.37.

Continue reading ...

Inexact rounding up or down with decimal digits

Calculations with floating point numbers are often producing small hidden bugs in some programming languages. For example rounding down or up with decimal digits. I want to show on some small examples in Java, JavaScript, Python and C the main problem.

Continue reading ...

Use TkInter without mainloop

I am building a small python program that is waiting for input from a bluetooth device. Depending on the input of the device I want to update my GUI. My decision was TkInter, the de-facto standard GUI for Python. But my main problem was the blocking method mainloop.

Continue reading ...