Here you will find instructions on how to assemble your PiPiano and then program it using both Python and C.
Please visit this page to see an assembly guide. This guide teaches you not only how to solder but how to put together your PiPiano kit.
You will need to set-up your Pi correctly to be able to use the PiPiano. Follow these instructions first.
In order to use the examples, you will need to use 'git' on your Pi to download the code. This is a simple procedure. First of all, open up a command line terminal and type in the following:
cd ~
git clone https://github.com/ZacharyIgielman/PiPiano
This will take around 5 minutes, and will download all the code to your home directory. To access the code, you will need to type
cd PiPiano
cd examples
The following examples are provided in both Python and C. If you do not have much experience programming, we recommend starting with Python as it is slightly easier to understand.
- button.py / button.c - a script that detects what buttons have been pressed on your PiPiano
- buzzer.py / buzzer.c - a script that plays sounds through your PiPiano's buzzer
- trafficLight.py / trafficLight.c - a script that displays a United Kingdom traffic light sequence using the LEDs on the PiPiano
- piano.py / piano.c - a script that detects button presses and plays the appropriate sound through the buzzer
The following additional Python example is provided:
- multitonePygameSampler.py - a script which detects button presses and uses Pygame to play the appropriate sound file through the Pi's headphone socket
- genSonicPi.py - a script which detects button presses and creates a text file containing instructions for Sonic Pi.
You can explore all of the code files using your favourite editor. First of all, change into the examples folder by typing:
cd examples
You can then open the code files in your editor. I recommend using nano which is used by typing:
nano nameoffile
For example:
nano piano.py
Each example file contains comments which explains what it does. Comments in any of the Python files start with a '#' symbol. In C files, the comments start with '//'.
In order to run the code in Python, you need to use 'sudo' (which allows access to the GPIO pins). So, for example you would type:
sudo python piano.py
In order to run C code, you first of all need to compile it. Each code file contains instructions on how to do this.