A simple physical controller for change and view the current pedalboard
Project description
A simple physical controller for change and view the current pedalboard with 2 buttons and 7 two segments displays
╔═══════════════════════════════════════════╗ ║ P e d a l P i P0 ║ ║ ┌ ⎯ ⎯ ┐ ║ ║ |⎥⎯⎜⎥ ⎜ | ║ ║ |⎥ ⎥⎯⎜.| ║ ║ └-------┘ ║ ║---------------------┬---------------------╢ ║ ..=.............=.. | .........=......... ║ ║ ....=.........=.... | ......=.....=...... ║ ║ ......=.....=...... | ....=.........=.... ║ ║ .........=......... | ..=.............=.. ║ ╚═══════════════════════════════════════════╝
- Documentation:
- Code:
- Python Package Index:
- License:
Elements list:
2 seven segments displays;
2 push buttons for Pedalboard change.
Installation
PedalPi components enable the extension of Pedal Pi - Application. Through them, opening services are offered. A list of components can be found in the Components repository.
Use the pip to install the PedalPi-Raspberry-P0
pip3 install PedalPi-Raspberry-P0
Create the program.py
The following example demonstrates a basic setup for the Pedal Pi - Raspberry P0. If you want to add other components, check the component list.
import sys
from signal import pause
from application.application import Application
from raspberry_p0.raspberry_p0 import RaspberryP0
application = Application(path_data="data/", address='localhost')
application.register(RaspberryP0(application))
application.start()
try:
pause()
except KeyboardInterrupt:
application.stop()
Start
python3 program.py
Schematic
The following image shows the connections between components and Raspberry Pi to the default configuration. If you wish to change the pins, refer to Configuration File.
Pins
The pins of the seven-segment displays are shared with each other. That is, the pin_a of display 1 is shorted with thepin_a of display 2, pin_b of display 1 is shorted withpin_b of display 2 and so on. However, this rule does not apply to common_pin, where each display must have its own control pin.
The used pins are:
Config identifier |
Pin¹ |
Type |
Function |
---|---|---|---|
pin_a |
13 |
integer |
Seven segments - Pin A |
pin_b |
6 |
integer |
Seven segments - Pin B |
pin_c |
16 |
integer |
Seven segments - Pin C |
pin_d |
20 |
integer |
Seven segments - Pin D |
pin_e |
21 |
integer |
Seven segments - Pin E |
pin_f |
19 |
integer |
Seven segments - Pin F |
pin_g |
26 |
integer |
Seven segments - Pin G |
pin_dp |
0 |
integer |
Seven segments - Dot point pin |
common_pins |
[5, 1] |
integer list |
Seven segments - Common pins |
common_anode |
True |
bool |
True if the displays are anode. False if are cathode. |
next_pedalboard |
14 |
integer |
Button - Set to next Pedalboard |
before_pedalboard |
15 |
integer |
Button - Set to before Pedalboard |
momentary_footswitch |
False |
bool |
True if buttons are momentary. False if buttons are two state |
Configuration file
It’s possible changes the pins using a configuration file. The numbering of the pins corresponds to BCM. Isn’t necessary to inform all configurations. An element not informed will be treated with your default value.
A Raspberry Pi pinout schematic can be seen in pinout.xyz.
The config_file has the following structure:
[display] pin_a = 13 pin_b = 6 pin_c = 16 pin_d = 20 pin_e = 21 pin_f = 19 pin_g = 26 pin_dp = 0 common_pins = [5, 1] common_anode = True [pedalboard] next_pedalboard = 14 before_pedalboard = 15 momentary_footswitch = True [test] test = False
For P0 to loads the new configuration, references the file in RaspberryP0 constructor.
# The config file has named as 'path/my_awersome_config.ini'.
application.register(RaspberryP0(application, configuration_file='my_awersome_config.ini'))
[display] Seven segments display
The seven-segment display consists of eight pins corresponding to the leds (pin_a topin_g and pin_dp) and two common pins (which are short-circuited).
There are two types of seven-segment displays: Cathode and Anode. common_anode informs if the displays are Anode or Cathode.
The image obtained from Circuits Today illustrates the correspondence of the pins with the LEDs.
Led pins
To save the amount of pins required for the project, the pins of the seven-segment displays are shared with each other. In this way, the pins corresponding to the pins leds (pin_a topin_g and pin_dp) must respectively be short-circuited to the displays. That is, the pin_a of display 1 is short-circuited with thepin_a of display 2, pin_b of display 1 is short-circuited withpin_b of display 2 and so on.
Config identifier |
Default value |
Type |
Function |
---|---|---|---|
pin_a |
13 |
integer |
Pin A |
pin_b |
6 |
integer |
Pin B |
pin_c |
16 |
integer |
Pin C |
pin_d |
20 |
integer |
Pin D |
pin_e |
21 |
integer |
Pin E |
pin_f |
19 |
integer |
Pin F |
pin_g |
26 |
integer |
Pin G |
pin_dp |
0 |
integer |
Dot point pin |
Common pins
To describe the common_pin of the displays, a list of integers is used, where the significance of the digits follows the ascending order: the tens corresponds to the first element of the list and the units to the second element of the list.
Config identifier |
Default value |
Type |
Function |
---|---|---|---|
common_pins |
[5, 1] |
integer list |
Pin that controls the display view |
common_anode |
True |
bool |
True if the displays are anode. False if are cathode. |
In Quora there is a tutorial on how you can identify if a display is cathode or anode.
[test] Test
Config identifier |
Default value |
Type |
Function |
---|---|---|---|
test |
False |
bool |
Disable GPIOZero for development tests |
Common questions
See FAQs on the wiki.
Examples
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file PedalPi-Raspberry-P0-0.2.1.tar.gz
.
File metadata
- Download URL: PedalPi-Raspberry-P0-0.2.1.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b25642a6314b4763fedf543e005cf9c0da0934a4aa69f6ad23c46b76135d18c |
|
MD5 | cbcb9584c4a6f6e15c4189654efd9aa0 |
|
BLAKE2b-256 | d061ded0a1503084fbf3f346b88d749e049a953eeb184671fe5af0aa5f1a108e |