T-622 / 25KHz-Arduino-Fan-PWM-Control

Arduino program that control individual timers OC1RA and ICR1. Allows for PWM control 0-100% and 8MHz.
22 stars 5 forks source link

error: 'setPwmDuty' was not declared in this scope #1

Open KitKat-ok opened 1 year ago

KitKat-ok commented 1 year ago

How do I fix this error message I didnt change anything in the code src/main.cpp: In function 'void loop()': src/main.cpp:34:5: error: 'setPwmDuty' was not declared in this scope setPwmDuty(0); ^~~~~~~~~~ *** [.pio/build/uno/src/main.cpp.o] Error 1

T-622 commented 1 year ago

Can you attach a copy of the code you're using? The issue in question is becuase the function:

void setPwmDuty(byte duty) { OCR1A = (word) (duty*TCNT1_TOP)/100; }

Would not be present at the bottom of the file. This should be there, as your error points that it is not declared; meaning that the function is not present properly.