Megszakításból nem lehet ki gotózni!!!
Van azon kívül még pár lehetőség.
Mondjuk az: If Feny = 750 Then Togle led
Kód: Egész kijelölése
$regfile = "attiny45.dat"
$crystal = 8000000
Dim Feny As Integer
Feny = 1
Led Alias Portb.1
Config Led = Output
Config Timer1 = Timer , Prescale = 1024
On Timer1 Novel
Enable Timer1
Enable Interrupts
Start Timer1
Main:
Do
'nop
Loop
Novel:
Feny = Feny + 1
If Feny = 750 Then
Toggle Led
Feny = 1
end IF
ReturnKód: Egész kijelölése
$regfile = "attiny45.dat" 'Chip
$crystal = 1000000
Config Portb.1 = Output
Config Portb.2 = Input
Config Int0 = Falling
Config Portb.0 = Output
On Int0 Vent
Reset Portb.0
Reset Portb.1
Reset Portb.2
Enable Interrupts
Enable Int0
Do
Set Portb.0
Waitms 500
Reset Portb.0
Waitms 500
Loop
Vent:
Set Portb.1
Set Portb.0
Wait 10
Reset Portb.1
Reset Portb.0
Return
EndKód: Egész kijelölése
Options:
Do
If Pind.6 = 0 Then Incr J
Bitwait Pind.6 , Set
If J > 2 Then J = 0
If Pind.7 = 0 And J = 2 Then Goto Main
Bitwait Pind.7 , Set
If Pind.7 = 0 And J = 0 Then Toggle Light
Bitwait Pind.7 , Set
Select Case J
Case 0 : Text = "light " + Str(light)
Case 1 : Text = " menu 2"
Case 2 : Text = " exit"
End Select
Gosub Sendnap
Waitms 300
LoopKód: Egész kijelölése
Bitwait Pind.7 , SetKód: Egész kijelölése
$regfile = "attiny13.dat"
$crystal = 9600000
Config Portb.4 = Output
Config Pinb.1 = Input
Config Timer0 = Timer , Prescale = 1024
Portb.1 = 1
Dim Rel_int As Bit , Reletime As Long , pluszido As Long,
Reletime = 0
Rel_int = 0
On Int0 Rele_time
Enable Int0
Config Int0 = Falling 'INT L->H átmenetre
Enable Interrupts
Do
'Print Reletime, pluszido
Loop
End 'end program
Rele_time:
SELECT Case Rel_int
Case 0 :
set Portb.4
Timer0 = 0
Start Timer0
Config Int0 = Rising 'Következő INT H->L átmenetre
Rel_int = 1
Case 1 :
Stop Timer0
Reletime = Timer0
pluszido=Reletime/5
Config Int0 = Falling 'Következő INT L->H átmenetre
Rel_int = 0
END SELECT
ReturnKód: Egész kijelölése
If Temp = 300 Then
Set Portb.7
Set Portb.5
Locate 1 , 3
Lcd " Err "
Portb.5 = 0
Waitms 200
Portb.7 = 0
Do
Loop
End If