Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Device 16F628A ;We gebruiken een 16F628A type
- Config INTRC_OSC_NOCLKOUT, WDT_OFF, PWRTE_ON, LVP_OFF, MCLRE_OFF
- All_Digital TRUE ;Alle ingangen digitaal
- Dim Servo1 As Byte
- Dim servo2 As Byte
- Dim teller As Byte
- Dim Teller1 As Byte
- Dim Alarmlichten As Byte
- Dim counter1 As Byte
- Symbol Kniptijd1 = 350
- Symbol Remtijd1 = 500
- Symbol Servopulsin1 = PORTB.1
- Symbol Servopulsin2 = PORTB.2
- Symbol Knipperlicht1 = PORTB.3
- Symbol Knipperlicht2 = PORTB.4
- Symbol Remlicht = PORTB.5
- Symbol Achteruitrijlicht = PORTB.6
- Main:
- If teller = 35 Then
- GoTo Eind
- EndIf
- For teller = 0 To 50
- DelayMS 350
- Servo1 = PulsIn Servopulsin1 , 1
- servo2 = PulsIn Servopulsin2 , 1
- If Servo1 > 121 And Servo1 < 179 Then
- Low Knipperlicht1
- Low Knipperlicht2
- EndIf
- If Servo1 < 120 Then
- Toggle Knipperlicht1
- Low Knipperlicht2
- EndIf
- If Servo1 > 180 Then
- Toggle Knipperlicht2
- Low Knipperlicht1
- EndIf
- If servo2 > 121 And servo2 < 179 Then
- Low Remlicht
- Low Achteruitrijlicht
- EndIf
- If counter1 = 1 And servo2 >120 Then
- High Remlicht
- counter1 = 0
- EndIf
- If servo2 < 140 Then
- counter1 = 1
- EndIf
- If servo2 > 160 Then
- High Remlicht
- EndIf
- If servo2 > 175 Then
- High Achteruitrijlicht
- Low Remlicht
- EndIf
- Next
- GoTo Main
- Eind:
- Low Knipperlicht1
- Low Knipperlicht2
- Low Remlicht
- Low Achteruitrijlicht
- teller = 0
- GoTo Main
- End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement