Skip to content

Arduino sketch that turns an ATtiny25/45/85 into a simple I2C PWM generator to control LEDs

License

Notifications You must be signed in to change notification settings

Qeteshpony/ATTiny_I2C_PWM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

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 to make this work.

About

Arduino sketch that turns an ATtiny25/45/85 into a simple I2C PWM generator to control LEDs

Topics

Resources

License

Stars

Watchers

Forks

Languages