Pi IoT In Python Using GPIO Zero - Compound Devices |
Written by Harry Fairhead & Mike James | |||||||
Monday, 07 February 2022 | |||||||
Page 3 of 3
This treats the LEDs connected to the specified pins as a bar graph. Setting a value between -1 and 1 lights up the corresponding proportion of the LEDs with negative values, working from the top of the list of pins. So: graph.value=0.5 sets the first half of the LEDs on and: graph.value=-0.5 sets the last half of the LEDs on. It is worth knowing that you can get packaged LED Bars with 10 or 20 segments. However, you need to keep in mind that allocating even as few as 10 GPIO lines to drive such a device might leave you short for other a
TrafficLights(red, amber, green, *, yellow=None, This controls a simple traffic light device by specifying the pins that the red, amber and green LEDs are connected to. You can control the lights using the red, amber, green attributes. The attribute yellow can be used as an alternative name for amber. You have to provide the code that changes the lights, e.g. green, red/amber, red and so on. You can also use PWM to vary the brightness, but it isn’t clear why you might want to do this. There are also some classes that work with off-the-shelf boards made by a number of different companies. In Chapter but not in this extract
Summary
Raspberry Pi IoT In Python Using GPIO Zero
|
Memgraph 3 Simplifies Graph Based AI Projects 11/02/2025 Memgraph has released an update to its graph database. The update aims to make it easier to build AI solutions powered by graph technology. |
InfluxDB 3 Core Released In Public Alpha 03/02/2025 Core, the new open source InfluxDB offering, promises enhanced performance and more freedom in using it under a permissive license. |
More News
|
Comments
or email your comment to: comments@i-programmer.info