I'm a complete idiot - and my PianoHAT doesn't work (at all) - (SOLVED)

Hello all,

Firstly, an extra big hello, and an huge apology. I recently, and happily, received a Raspberry Pi 4 (4GB) as a gift. I saw the Pimoroni PanioHAT, and as a lover of classical music, I couldn’t resist. Trouble is, I have no coding know’how and I’m completely lost. Please help, if you can.

So, I’ve seated the PianoHAT directly on the GPIO pins.I’m confident that it’s seated firmly, and correctly. I have then followed the installation guidance on the official website (Getting Started with Piano HAT). By doing so, I have oped up Terminal and entered the following code… curl https://get.pimoroni.com/pianohat | bash. It says everything has installed correctly. I’ve then gone into /home/pi/pimoroni/pianohat/examples and clicked on a few .py files. These say ‘Execute’ ‘Execute in terminal’ ‘open’ ‘close’. I have clicked on ‘execute’ or ‘execute in termainl’ nothing happens. When I click on ‘open’ Thonny opens up. I clicked on ‘run’ but I get an error. It reads…

Python 3.9.2 (/usr/bin/python3)
>>> %Run leds.py
Traceback (most recent call last):
** File “/home/pi/Pimoroni/pianohat/examples/leds.py”, line 8, in **
** pianohat.auto_leds(False)**
** File “/usr/lib/python3/dist-packages/pianohat.py”, line 85, in auto_leds**
** setup()**
** File “/usr/lib/python3/dist-packages/pianohat.py”, line 194, in setup**
** _piano_ctog = cap1xxx.Cap1188(i2c_addr=0x28, alert_pin=4)**
** File “/usr/lib/python3/dist-packages/cap1xxx.py”, line 253, in init**
** self.i2c = SMBus(i2c_bus)**
FileNotFoundError: [Errno 2] No such file or directory
>>>

I have also noticed that non of the LED’s light up.

I’m really sorry, this is probably a very noob question, but I would be grateful for all your help.

Cheers, Matt.

Make sure i2c is enabled.

1 Like

posting this just in case , how to check ,I have owned Pi’s for yrs ,and wold still have to lookup this how to ;)

  1. Run this command: sudo raspi-config.
  2. Select Interfacing Options > I2C.
  3. Select Yes when prompted to enable the I2C interface.
  4. Select Yes when prompted to automatically load the I2C kernel module.
  5. Select Finish.
  6. Select Yes when prompted to reboot.
1 Like

Thanks Alphanumeric & Caperjack1953 !!! Hours of tinkering was solved in minutes with your expert help. I’m really grateful :)

Matt

2 Likes

It’s an easy mistake to make, been there done that. ;)

I’m post this just incase you add a drumHat and speaker phat someday . its a cool setup Alphanumeric and I both have ,I dont this speakerphat is avaible any more though …my grankids like playing with it when they come to visit Build an Itty Bitty Beat Box

I used the Pirate Audio Speaker on mine, couldn’t get the Speaker pHat.