void light() {
if (Serial.available()) {
dim = Serial.read();
Once you enter the ISR, interrupts are disabled - you can't have an interrupt interrupting an interrupt - and Serial uses interrupts, so that will be an issue.
void light() {
if (Serial.available()) {
dim = Serial.read();
Once you enter the ISR, interrupts are disabled - you can't have an interrupt interrupting an interrupt - and Serial uses interrupts, so that will be an issue.