Black HAT Hack3r with PianoHat and DrumHat

Hi!!

I just bought PianoHat and after a short install i enjoyed playing with it!
Now i have a DrumHat and a Black Hat Hack3r and i’m wondering how i could make them work together?

i’m pretty new to linux and raspberry but i try hard :D

Also, if i want to launch PianoHat on boot i could edit rc.local file before the end with
cd /home/pi/pimoroni/pianohat/exemples
Sudo python simple-piano.py
?

Thks in advance for your answer!

You should just be able to plug both HATs onto the BHH, install the Piano HAT and Drum HAT libraries using the one-line-installers, and then run the example scripts in two separate terminal windows/tabs.

My preferred method of choice for running scripts at boot is to use cron with @reboot, as follows:

crontab -e and then add @reboot sudo python /home/pi/myscript.py to your crontab.

Super-simple!

Hi

Thx a lot!
My BHH was a mini one, so i’m thinking on buying à big one cause it’s really small, but hey! It work!

I also made my rpi3 a wireless hotspot (without network connection, but no need) so i can control it with my phone (serverassistant app), no screen needed.

Last question, on cronetab i use 2 command
Sudo python /home/pi/Pimoroni/pianohat/examples/simple-piano.py
Sudo python /home/pi/Pimoroni/drumhat/examples/drums.py

Any way to shorter these commad?
Even if there fine right now…

Thx again!

you can (IMO should) drop the sudo. If your scripts are executable and have an interpreter specified then you can also call them without specifying what command is needed:

~/Pimoroni/pianohat/examples/simple-piano.py
~/Pimoroni/drumhat/examples/drums.py

you could also copy them to a directory inside your home directory, say mycron, and use:

~/mycron/simple-piano.py
~/mycron/drums.py

Hi,

Sorry for the late answer… And Thx for the tips it work great!
I Just checked the “pinout” website to see if i could Add a pHat dac and made my setup on pizero. It seems that the drumhat and pHat dac share 1 pin (gpio 21 i think) Will it be a problem?
Also, on pianohat it’s powered by 5v or 3.3v ?

Thx a lot!

Hi !

I finished my little instrument for all kids at my weeding ^^
nothing fancy but it work very well!
I add a pushbutton to shutdown safely the pi :)


1 Like