Fix readme

This commit is contained in:
ABelliqueux 2024-12-19 18:09:08 +01:00
parent 5260330863
commit 3afc1555f4
1 changed files with 9 additions and 30 deletions

View File

@ -32,7 +32,7 @@ This python script is supposed to run on a rpi and does the following :
| OLED | GND, 3.3V, 2(SDA), 3(SCL) |
| 5 BUTTONS | GND, 7, 8, 9, 11, 25 |
| POTENTIOMETER | GND, 3.3V, 23 |
| RELAY | GND, 5V, 17 |
| ROTARY ENCODER | GND, 3V3, 27, 22 |
You can check these here : [https://pinout.xyz/](https://pinout.xyz/)
@ -79,37 +79,16 @@ If you're short on GPIOs, there is a way to use a single GPIO for multiple butto
#### Potentiometer circuit
Using the 'step response' method described [here](http://razzpisampler.oreilly.com/ch08.html#Discussion) (It's the same principle as in the link above),
we can use an analog potentiometer to control volume.
Using [https://github.com/Tr3m/rpi-rotary-encoder](https://github.com/Tr3m/rpi-rotary-encoder), we can use a 3-pins rotary encoder to control volume.
The solution described in the previous link is not very accurate though, so we'll be using an alternative solution offered by abyz.me.uk :
##### Wiring
[https://abyz.me.uk/rpi/pigpio/examples.html#Python_pot_cap_py](https://abyz.me.uk/rpi/pigpio/examples.html#Python_pot_cap_py)
##### Components
* 100nf Ceramic capacitor
* 5KΩ Potentiometer
##### Diagram
```
3V3 ----- Potentiometer --+-- Capacitor ----- Ground
|
+-- GPIO 23
```
Instructions for use are in the source file. The library ('pot_cap.py') is included in this project for convenience.
You might have to install the 'pigpio' library though :
```
sudo apt install python3-pigpio
```
You can find out more about installing 'pigpio' here :
[https://abyz.me.uk/rpi/pigpio/download.html](https://abyz.me.uk/rpi/pigpio/download.html)
| ENCODER | RPI GPIO # |
| --- | --- |
| GND | GND |
| + | 3V3 |
| CLK | 27 |
| DT | 22 |
## Optional steps