Hello all, 
 
i have a problem with the following code. 
 
It works with the compiler 2.4o. But with the last 2.4q, the ccp1 doesn't 
work.

Maybe a compiler bug?

Regards,

Enzo

-- chip setup
include 16f877a

pragma target   clock 4_000_000                  -- xtal frequency
pragma target   OSC       xt
pragma target   LVP disabled
pragma target   WDT disabled

enable_digital_io()

include delay

-- Configure PWM
pin_ccp1_direction = output
pin_ccp2_direction = output

include pwm_hardware

pwm_max_resolution(1)

pwm1_on()
pwm2_on()

pwm1_set_dutycycle_percent(0)
pwm2_set_dutycycle_percent(0)

forever loop

 -- Moteur Avant

   pwm1_set_dutycycle_percent(100)
   pwm2_set_dutycycle_percent(100)

   delay_1ms (1000)

 -- Moteur Stop

   pwm1_set_dutycycle_percent(0)
   pwm2_set_dutycycle_percent(0)
   
   delay_1ms (1000)

 -- Spin Right

   pwm1_set_dutycycle_percent(90)
   pwm2_set_dutycycle_percent(90)

   delay_1ms (1000)

 -- Moteur Stop

   pwm1_set_dutycycle_percent(0)
   pwm2_set_dutycycle_percent(0)
   
   delay_1ms (1000)

 -- Moteur Arriere

   pwm1_set_dutycycle_percent(100)
   pwm2_set_dutycycle_percent(100)

   delay_1ms (1000)

 -- Moteur Stop

   pwm1_set_dutycycle_percent(0)
   pwm2_set_dutycycle_percent(0)
   
   delay_1ms (1000)

 -- Spin Left

   pwm1_set_dutycycle_percent(90)
   pwm2_set_dutycycle_percent(90)

   delay_1ms (1000)

 -- Moteur Stop

   pwm1_set_dutycycle_percent(0)
   pwm2_set_dutycycle_percent(0)
   
   delay_1ms (1000)
   
end loop

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/jallib.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to