Pi Servo pHAT example for LED control

Hello,

Sorry for the question - I am a noob without SW dev. Experience…

I am trying to control some LEDs (and later servos) from a RPI Zero with the Pi Servo pHAT over Python. The pHAT is having its own USB power source independent of the RPI.

While I do find sample code for servo control, I am unclear how to control some LEDs. I wish to run them using the pHAT instead of the GPIO due to the power consumption.

Would you be share any sample code for a first test? I am not getting anywhere.

Thanks!

Hi Stemmi,

All of the example code we have for the Servo pHAT can be found in the [Software Section of our Hookup Guide. If you’re not familiar with Pulse Width Modulation I would recommend taking a look at our [tutorial for it.](https://learn.sparkfun.com/tutorials/pulse-width-modulation#examples)](https://learn.sparkfun.com/tutorials/pi-servo-phat-v2-hookup-guide/software---python)