UnicornhatHD stops working forever after running code from Unicornhat regular

Encountered this the other day so I made fresh install to track down the issue.
I was able to reproduce it thusly:

  1. Fresh raspberrian install
  2. full install of pimoroni unicornhathd and unicornhat from github.
  3. run unicornhatHD demo - works fine
  4. run unicornhat code (any?) - throws no error but nothing on display (as expected)
  5. run unicornhatHD code (any) and nothing displays - no error, nothing

Reboot doesn’t fix it. Re-installing unicornhatHD github doesnt fix it.

Please Advise.


Are you actually running the Unicorn Hat HD and the Unicorn Hat installer?
You should only be running the HD installer.
The Unicorn Hat examples need to be modified to run on the HD.

My intent is to run the unicorn hat hd and unicorn hat at the same time.

The unicorn hat hd works fine UNTIL the unicorn hat code is run ONCE (when the vanilla unicorn hat is not plugged in, if it helps). After that the unicorn hat hd NEVER LIGHTS UP AGAIN no matter what I do. The vanilla unicorn hat continues to work fine when I plug it in.

The fact that this persists after reboot is very perplexing.
I have to completely reinstall OS to get hd hat working again - what the heck is going on?

I don’t know? The HD uses SPI and the non HD uses just the one data line, NEOpixel like?
I have the Unicorn Hat Mini and the Unicorn Hat HD. I’m not 100% sure, but I think I have run them both on the same Pi Zero W.
Are you running the examples from terminal or through an IDE? If you run them from thonny it may get you an error message.

Working now, not sure what I was doing wrong. Please disreguard.

Be sure to shut down, and remove power before removing or attaching anything to the GPIO header.
Maybe its dependent on what example file your run, and what that example does?

The code that was flummoxing me turned out to be rainbowhat.rainbow.show()
The error did not persist after reboot, I just had code that ran on startup that fired the rainbowhat code without checking to see if it was plugged in.

The code which fixed it:

import smbus
bus = smbus.SMBus(1) # 1 indicates /dev/i2c-1