I might have goofed.. mote pHat flickers

Hi, I recently purchased a mote phat, soldered the female header on and hooked it all up.

I installed the Pimoroni Dashboard and all went well, grabbed the examples for motephat, worked.

I ran some of them and they seemed okay.

I have the RGB/White sticks… so I wanted to set every other pixel (white) or (rgb) so I did this

#1/usr/bin/env python
import motephat
import time

motephat.set_brightness(1)
num_pixels = 16

motephat.configure_channel(1, num_pixels, False)
motephat.configure_channel(2, num_pixels, False)
motephat.configure_channel(3, num_pixels, False)
motephat.configure_channel(4, num_pixels, False)

motephat.clear()

for channel in range(1, 5):
for pixel in range(num_pixels):
if pixel % 2 == 0:
motephat.set_pixel(channel, pixel, 255, 0, 0)
if pixel % 2 != 0:
motephat.set_pixel(channel, pixel, 255, 255, 255)

motephat.show()

Anyway, it’s all wonky and all sorts of colors show up, sometimes a channel will be off, and if I touch the mote phat at all or anything it freaks out and starts shifting colors and pixels on and off. Have I damaged the phat? or is my code all wrong? Please assist.

Is there any other code running on your Pi that could be interfering with Mote pHAT?

Also you should change: motephat.show() to something like:

while True:
    motephat.show()
    time.sleep(0.001)

Since the Mote strips contain “Intelligent” pixels, they’re subject to external noise being interpreted as signal. If you touch them, or a coupled-in signal from your environment is strong enough, then there’s a high probability that signal will be interpreted as data. This will result in the sort of weirdness you describe!

Thanks for the reply. Changed what you suggested and moved the mote strips… they were next to my Qi charger and I think that was part of it. All of this has helped.