I’m trying to build an auto-tracking laser turret with Pan-Tilt HAT, but there’s a problem that all the pinouts on the raspberry pi are taken, so can I attach my laser transmitter directly to the light channel on the Pan-Tilt HAT and control it?
I’m using a KY-008 LASER TRANSMITTER MODULE, and I find a tutorial about this model. But the problem is I don’t know C at all, I’m only familiar with Python.
So could you help me control this laser transmitter(on/off is enough) with it attached to the light channel on Pan-Tilt HAT(if it’s possible)? Some Python 3 code will be super helpful.
Or any other advice about better components or other methods to control the laser transmitter is welcome!
Thanks!
That “Light” connector is meant to be used with NEOPIXELS. The 5V is likely there all the time and can’t be turned off via software. The Data pin is well a data stream sent to the Neopixel strip to tell it which LED to turn on and what color it should be etc.
That being said, if you go here, http://docs.pimoroni.com/pantilthat/ and look in the setting light mode and type.
It looks like you could switch it to regular leds and use PWM to adjust how bright it is.
PWM - PWM-dimmable LEDs
pantilthat.light_mode(PWM)
And pantilthat.brightness(brightness)
to set brightness. 0 would turn it off and 255 would be full on.
The Pan Tilt Data Pin would go to Pin 1 S on your DIOD and Ground to ground pin 3 on the DIOD.
You’ll want to read up and double check this before doing it so nothing bad happens.
I may try this my self at some point, I want to build a second pan tilt with a NOIR night vision camera and some IR Leds.