This is a quick start guide to code audio effects for Pedal Pi. I am going to explain just the basic ideas you need to know to progress as fast as possible, enjoy the trip!:
1. What Do You Need to Know About the Hardware?
You need to know how where the hardware resources (push-buttons, toggle-switch, led, foot-switch, analog guitar input and audio signal output) are connected.
This image summarizes it all:
This image would also help you:
2. Installing the Software.
You would need to install the Operating System (Raspbian) and the Libraries (BCM2835) before you can start coding.
Once you have installed Raspbian in your SD card you will need to be able to "access" it so you can start coding, there are two ways to access a pi zero:
Classic: By connecting an HDMI screen and a keyboard, like any other computer. Easy and fast.
Headless Mode: Once you have configured the network, you can access remotely the pi zero from your laptop or computer. There are several
tutorials online for Linux and windows (link2).
Installing the BCM2835 Libraries.
Once the OS is installed and you can access it, it is time to install the BCM2835 libraries. This libraries will help us to access the GPIOs pins, SPI and PWM with simple C commands, making the coding easy and intuitive.
In the BCM2835 website there is a tutorial to install the libraries:
However, it is pretty easy, just doing:
wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.50.tar.gz; // If there is a new release, this link should be changed.
tar xvfz bcm2835-1.50.tar.gz;
sudo make install
To make sure that all is working fine, go to the BCM2835 installation folder and try to compile any example there, for instance:
3. Start Coding!
There are examples of pedals already coded and available in the forum. All this effects have "educational" purposes. The idea is to have them as a base to start improving or coding your own effects. The codes have a balance between performance and complexity for you understand them easily.