using either a rotory encoder or button press count to change pwm mode

VirtualDDS:
it does not like the layout of the int command warning only initialized variables can be placed into program memory area

With verbose compilation off, I get:

Binary sketch size: 902 bytes (of a 32256 byte maximum)