10 years, 2 months ago.

I2C Fan Controller

Hi, I am using a Microchip TC664 to control a small fan. Now I want to modify my program to run the fan for 20 seconds at half speed then 20 secs at full speed. For example:

Start

Run motor for 20 seconds at 50%

Stop

Run motor for 20 seconds at 100 %

Stop

I can't quite work out what function to use for the timing part of the code. Any suggestions anyone please?

1 Answer

10 years, 2 months ago.

With timing you mean the 20 seconds? If there is nothing else to do, simply use wait(20);. If there is something else to do, use for example a TimeOut (check the handbook page). Start the motor, attach a 20 seconds timeout. In that function change the speed of the motor, and attach next function to the timeout, etc.

Accepted Answer