Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/qeteshpony/attiny_i2c_pwm
Arduino sketch that turns an ATtiny25/45/85 into a simple I2C PWM generator to control LEDs
https://github.com/qeteshpony/attiny_i2c_pwm
arduino attiny25 attiny45 attiny85 i2c pwm-controller pwm-generator
Last synced: 8 days ago
JSON representation
Arduino sketch that turns an ATtiny25/45/85 into a simple I2C PWM generator to control LEDs
- Host: GitHub
- URL: https://github.com/qeteshpony/attiny_i2c_pwm
- Owner: Qeteshpony
- License: bsd-2-clause
- Created: 2024-10-11T17:28:57.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-10-11T17:32:00.000Z (2 months ago)
- Last Synced: 2024-12-08T01:01:13.294Z (15 days ago)
- Topics: arduino, attiny25, attiny45, attiny85, i2c, pwm-controller, pwm-generator
- Language: C++
- Homepage:
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-BSD-2-Clause
Awesome Lists containing this project
README
# I2C PWM for ATtiny25/45/85
A very simple Arduino sketch that turns an ATtiny25/45/85 into a simple I2C PWM generator to control LEDs.
Nothing fancy but it works if you, like me, have tons of ATtiny85s in your drawer but no dedicated pwm ICs...
I think the sketch is self explaining but in short:
The device listens on I2C Address 0x20
Register 0x10 can have its LSB set to 1 or 0 to turn the pwm on or off without losing the settings. All other bits are ignored.
Register 0x11 sets the duty cycle from 0 to 255
You will need [ATTinyCore](https://github.com/SpenceKonde/ATTinyCore) to make this work.