Open slayernn021 opened 9 months ago
For sure! You just need to adjust the duty cycle based on a "Mapped" analog value (IE: 0-1023, 0-100). The code in the main loop could be replaced by the following:
NOTE: This code assumes you use analog pin #0 for reading
int pwmDuty = analogRead(0); pwmDuty = map(pwmDuty, 0, 1023, 0, 100); setPwmDuty(pwmDuty);
Use the above indicated code snippet to replace the contents of void loop()
from what they are now. Hook a potentiometer's pin to A0, and this should change duty based on the analog value (0-1023), which gets mapped to 0-100% duty cycle, which controls the PWM's duty cycle on the output.
Tell me if this works, Tyler
I have some 10k pot, work perfect from start! Thanx very much!!
Hello. This project is great in my setup, using 80mm server fan,work perfectly and thanx for it! I want to ask, is it posible to add potentiometer to control setPwmDuty cycle and how? Im arduino beginer, i know to handle and mod code but thats it. Thx