I’ve maid my first project with XOD.
But i think it’s very complicated and maybe somebody made same things more optimal?
I have one button and three-grade (actually four) PWM - 0% , 50% , 75% and 100%.
- On boot everything off - 0%
- When i press one time - PWM changing to 75%
- When i press one time (delta-time between two presses more than 2 seconds) - 75% changing to 0% and cycling between 75 and 0
- When i press two or more times (with delta time less than 2 seconds) - PWM changing to 100 > 50 > 75 > 100 > 50 >75 and so on.
- When i stopped on some percents (delta-time between two presses more than 2 seconds) - algorithm like #3 - cycling between current percents and 0.
This algorithm for controlling coolers (ventilation system). Very useful - i made (actually copied) such kind of project on Attiny13 and AVR Studio (for pocket lighter) but for now i need to extend this algorithm if future and Attiny has less pins and timers than i need (this needs in future to react on logic true and off timer additionally).
Thanks for reading!