I know the code is not yours but you altert it. So that’s why I said you’re name. Well about the switch, it depends on what could be possible. It may be a simple on/off switch. But a push button or even a remote button would be an option iff it’s possible offcourse.It's not my code. It's a slightly modified version from the link that you provided. I'm not sure if you want the two different PWM values (10% and 90%) selected by an on /off switch or to toggle between them with a push button. I am useless at programming in "C" so I have saved the assembler source code produced by the Arduino IDE as that make more sense to me. I have worked out that it is using 8 bit PWM so that the number that you enter to get the percentage value you want is 2.56 times the percentage value. So for 10% you enter 26 (Decimal) as that is the closest integer to 25.6) For 90% you enter 230 decimal. (The closest integer to 230.4)
Les.