Pantilthat light control

So the pimoroni pan tilt hat has three headers on the bottom - 2 for the servos and one for an LED light strip. Instead of a light strip i want to use a small laser diode. The diode runs at 5v but i can’t figure out how to turn it on-off. I tried setting the light_mode to 0 (for PWM control) and then using set_all(0,0,0,0) but nothing seems to work.

I suppose I could hook up the diode to one of the GPIO pins on the pi but I can’t really access them with the hat in place. Suggestions?

The Neopixel library likely isn’t going to work, Neopixels are addressable. I’m not sure if thats what your doing, just pointing out it likely aint going to work.
That being said, on my Sense Hat (0,0,0) is all off and (255,255,255) is all three LED’s (R,G,B) on at full bright.
There is a secondary header on the Pan Tilt Hat and I see a PWM pin there. That might work? One thing to be concerned about is how much current the laser diode draws. The GPIO pins can be damaged by excessive current draw.

These are the diodes I am using


They are 5v 5mw so i guess that means they draw 1 mA. Well under the 16ma max per pin and 51mA max total.
I’d like to use the header underneath the pantilthat but that did not work.
Even after issuing
pantilthat.light_mode(0)
pantilthat.brightness(255)
Then I tried hooking up the diode to the PWM on the top of the pantilthat and the ground to the ground - nothing. Again tried all commands from the pantilthat library but from what i understand, the pin holes on the top of the pantilthat are not controlled by the pantilthat library- they are just pass through from the GPIO/
The diode does light up of course if i connect it to the 5v or 3v holes on the pantilt hat - so there is power there.
So I think I have to use the RPi.GPIO library and select the pins i want to use. But now, I dont know which ones to use? Normally I use BCM 18 as a switch pin and BCM 23 as the hot pin for an LED.

Yes, 5mW is 0.005 W. Divide that by 5 and thats 0.001 A or 1mA.
You should be able to drive it with a GPIO pin. Getting access to a pin could be the tricky part.
That secondary header on the Pan Tilt is just some of the commonly used GPIO brought out for easy access. The UART pins are GPIO 13 and 14. You should be able to reassign those for use as regular GPIO pins and make them high or low just like any other PIN. Most GPIO pins have a double function that is selectable.in python.
You could also if you wanted to, solder the header on so the pins are on the bottom of the pan tilt. It doesn’t matter what side the header is soldered on.