Bill z
Member
New guy here again asking for guidance with a 08M2 and its PWMDUTY command and circuit. In the editor, this program I found on this forum looks like it is working, and at one time I did have it running on my 08M2 chip. But now, the LED won’t light up. Terminal in the editor shows the program is running, looping and incrementing but no light in the LED.
The LED is good and in series with a 268 ohm resistor from pin C.2 to ground.
The LED works on the same 08M2 on pin C.4 when running a PWM command.
Being new, I have been trying all sorts of things and commands to experiment and learn.
I hope, I’m just overlooking something.
Can someone help.
Here is the program and the Terminal results:
The LED is good and in series with a 268 ohm resistor from pin C.2 to ground.
The LED works on the same 08M2 on pin C.4 when running a PWM command.
Being new, I have been trying all sorts of things and commands to experiment and learn.
I hope, I’m just overlooking something.
Can someone help.
Here is the program and the Terminal results:
1 17->400 18->425 19->450 20->475 21->500 22->525 23->550 24->575 25->600 26->625 27->650 28->675 29->700 30->725 31->750 32->775 33->800 34->825 35->850 36->875 37->900 38->925 39->950 40->975 41->1000
2 1->975 2->950 3->925 4->900 5->875 6->850 7->825 8->800 9->775 10->750 11->725 12->700 13->675 14->650 15->625 16->600 17->575 18->550 19->525 20->500 21->475 22->450 23->425 24->400 25->375 26->350 27->325 28->300 29->275 30->250 31->225 32->200 33->175 34->150 35->125 36->100 37->75 38->50 39->25 40->0
3 1->0 2->25 3->50 4->75 5->100 6->125 7->150 8->175 9->200 10->225 11->250 12->275 13->300 14->325 15->350 16->375 17->400 18->425 19->450 20->475 21->500 22->525 23->550 24->575 25->600 26->625 27->650 28->675 29->700 30->725 31->750 32->775 33->800 34->825 35->850 36->875 37->900 38->925 39->950 40->975 41->1000
4 1->975 2->950 3->925 4->900 5->875 6->850 7->825 8->800 9->775 10->750 11->725 12->700 13->675 14->650 15->625 16->600 17->575 18->550 19->525 20->500 21->475 22->450 23->425 24->400 25->375 26->350 27->325 28->300 29->275 30->250 31->225 32->200 33->175 34->150 35->125 36->100 37->75 38->50 39->25 40->0
5 1->0 2->25 3->50 4->75 5->100 6->125 7->150 8->175 9->200 10->225 11->250 12->275 13->300 14->325 15->350 16->375 17->400 18->425 19->450 20->475 21->500 22->525 23->550 24->575 25->600 26->625 27->650 28->675 29->700 30->725 31->750 32->775 33->800 34->825 35->850 36->875 37->900 38->925 39->950 40->975 5
Code:
'#picaxe 08M2
symbol pLED = C.2 ' 08M2
symbol wDutyCycle=s_w1
symbol wIncrement=s_w2
symbol loopCnt=b27
symbol INCREMENT=25 ; 10-103 15-69 20-52 25-41
wDutyCycle=0-INCREMENT
wIncrement=INCREMENT
main:
for loopCnt=1 to 41
wDutyCycle=wDutyCycle+wIncrement
if wDutyCycle < 1023 then
pwmduty pLED,wDutyCycle
sertxd(#loopCnt,"->",#wDutyCycle," ")
pause 250
endif
next loopCnt
wIncrement=0-wIncrement ' toggle between 100 & -100
sertxd(cr,lf)
goto main