I am trying to create code for driving a motor speed controller. I thought the following code would increase the speed of the motor as the the loop executed but the motor rpm just runs at full speed. Can someone please tell me what I may be doing wrong? I have tested the other hardware and it is fine. Thank you for your help.
#CHIP 12F683, 4
#config OSC = INT, MCLR = OFF, PWRT = OFF
#define Delay 600 ms
Dim I as Word
DIR GPIO.2 OUT
Cycle:
Wait Delay
For I = 1 to 255
HPWM 1, 20, I
Next I
Goto Cycle
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to create code for driving a motor speed controller. I thought the following code would increase the speed of the motor as the the loop executed but the motor rpm just runs at full speed. Can someone please tell me what I may be doing wrong? I have tested the other hardware and it is fine. Thank you for your help.
#CHIP 12F683, 4
#config OSC = INT, MCLR = OFF, PWRT = OFF
#define Delay 600 ms
Dim I as Word
DIR GPIO.2 OUT
Cycle:
Wait Delay
For I = 1 to 255
HPWM 1, 20, I
Next I
Goto Cycle
I got this problem solved. I still don't know why it wasn't working but it is now. Thanks for looking!