40x1 and pwmout pwmdiv error

gtslabs

Member
I am tring to work withe 40x1 and pwmout command
When I add the pwmdiv it tells me I have an error in the way I am referencing portc 2
any ideas?

Code:
#picaxe 40X1
high portc 2
pwmout  portc 2, 249, 500
do:loop
but this does not when I add in the pwmdiv4

Code:
#picaxe 40X1
high portc 2
pwmout PWMDIV4, portc 2, 249, 500
do:loop
 

westaust55

Moderator
Try removing the "portC" part as follows:

Code:
#picaxe 40X1
high portc 2
pwmout PWMDIV4, 2, 249, 500
do:loop
Have you tried entering the requirements into the PE Wizard for the PWM function?
 

hippy

Technical Support
Staff member
I would guess the "PWMOUT PORTC <pin>" option was added for convenience when using the X1 devices, and when PWMDIV options were added this particular case was not provided for. I've made a note of that.
 
Top