jandelgado / jled

Non-blocking LED controlling library for Arduino and friends.
MIT License
324 stars 51 forks source link

Add Custom hal example for PCA9685 PWM breakout board #98

Closed samjt closed 1 year ago

samjt commented 1 year ago

This is an example for using a PWM extender board.

My c++ is pretty amateurish, so there are probably some things to change.

One issue is that the PCA board sets brightness across a higher resolution than jled (4096 levels instead of 256). I think this is the reason there is some flickering during fades, but I’m not sure how to correct it. At the moment I’m just doing map(val, 0, 255, 0,4095) in the analogWrite call.

jandelgado commented 1 year ago

Thanks for the contribution! However, in order to make an executable example, it still needs some polishing. Since I've a PCA9685 somewhere around, I can take care of that and take your work as a starting point. Also I would like to put the example in a separate repository, since it has additionals dependencies (the PCA9685 driver - which I don't want to add to JLed). See https://github.com/jandelgado/jled-example-switch-sequence for an example.

coveralls commented 1 year ago

Coverage Status

Coverage remained the same at 96.97% when pulling f3b359e90bb9bcf6124e8f2377d95d50364b61b4 on samjt:patch-1 into 9b657ace7363bc1b8cc1f4f528019efbf26f6bed on jandelgado:master.

samjt commented 1 year ago

Sure, I thought that would be the case but I don’t think I can open a pr to start a new repo. Feel free to close

jandelgado commented 1 year ago

@samjt: I have added a new library with a PCA9685 HAL: https://github.com/jandelgado/jled-pca9685-hal/

See the repo for usage examples / documentation.

samjt commented 1 year ago

Amazing, and great detailed documentation, thank you.