Witam!
Wentylatorek piszczy przy każdym z 10 poziomów PWM'a. Jeżeli ustawie Port na stałe 1 to chodzi normalnie. Co jest nie tak z tym programem?
Wentylatorek piszczy przy każdym z 10 poziomów PWM'a. Jeżeli ustawie Port na stałe 1 to chodzi normalnie. Co jest nie tak z tym programem?
$regfile = "m8def.dat"
$crystal = 8000000
Config Portc.5 = Output
Dim Licz As Byte
Dim X As Byte
Dim A As Byte , B As Byte , C As Byte , D As Byte
Dim Z As Byte
Config Timer0 = Timer , Prescale = 1
On Timer0 Przerwanie
Enable Timer0
Enable Interrupts
Dim P As Byte
Licz = 0
Z = 10
Do
Loop
End
Przerwanie:
Incr Licz
If Licz <= Z Then Set Portc.5
If Licz > Z Then Reset Portc.5
'If Licz > 10 Then Licz = 0
'If Licz = 0 Then Portc.5 = 0
Return