Hi,
my explanation is same like coding below:
but that coding only applicable for 1 phase only.Code:defineosc 20 DUTY1 var word DUTY2 var word FREK var word frek=5000 Loop: high port.1 GOSUB FIRE low portb.1 high portb.2 GOSUB fire low portb.2 gotoLoop fire: For DUTY1 = 0 TO 44 LookUp DUTY1, [0,18,35,53,70,87,104,120,135,150,164,177,190,201,211,221,229,236,_ 243,247,251,254,255,254,251,247,243,236,229,221,211,201,189,_ 177,164,150,135,120,104,87,70,53,35,18,0],DUTY2 hpwm 1,DUTY2,frek next DUTY1 RETURN end
based on your coding example, i want it to be:
The 1st time it count from 0 to 185 , portc.3 will be high and portc.0 will be low then 2nd time it count from 0 to 185, portc.3 will be low and portc.0 will be high.
do i need to make new loop, let say:
loop:
IF Phase[0] =0 '1st time it count
high portc.3
low portc.0
then Phase[0]=0 'second time it count
high portc.0
low portc.3
goto loop
please help advice
photoelectric
Bookmarks