Hello.
I need to programm a PIC to drive a DC Motor, using a C language (I use mikroC progamming environment). The speed will be constantly changing during the operation. Say I have a float variable X, which represents desired speed in cm/sec. I am using 2 PORTB pins as motor inputs (forward and backward motion inputs of DC motor).
I know that this kind of things are done using Pulse Width Modulation Method (PWM), but I couldn't find any example in C language (I don't understand Basic well). Any suggestions will be appreciated.
Thank you,
Gtofig
I need to programm a PIC to drive a DC Motor, using a C language (I use mikroC progamming environment). The speed will be constantly changing during the operation. Say I have a float variable X, which represents desired speed in cm/sec. I am using 2 PORTB pins as motor inputs (forward and backward motion inputs of DC motor).
I know that this kind of things are done using Pulse Width Modulation Method (PWM), but I couldn't find any example in C language (I don't understand Basic well). Any suggestions will be appreciated.
Thank you,
Gtofig