Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $regfile = "attiny13.dat"
- $crystal = 4800000
- $hwstack = 8
- $swstack = 16
- $framesize = 16
- Dim S1 As Byte
- S1 = 0
- Config Portb.2 = Output
- Config Portb.3 = Output
- Config Portb.1 = Input
- Config Int0 = Falling
- On Int0 Button:
- Enable Interrupts
- Enable Int0
- Do
- If S1 = 0 Then
- Portb.2 = 0
- Portb.3 = 0
- Powerdown
- End If
- If S1 = 4 Then
- S1 = 0
- End if
- Loop
- Button:
- Wait 1
- Incr S1
- If S1 = 1 Then
- Portb.2 = 1
- Portb.3 = 0
- End If
- If S1 = 2 Then
- Portb.2 = 0
- Portb.3 = 1
- End If
- If S1 = 3 Then
- Portb.2 = 1
- Portb.3 = 1
- End If
- Gifr = 64
- Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement