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
- Symbol Kniptijd1 = 350
- Symbol Remtijd1 = 500
- Main:
- Servo1 = Pulsin Portb.1 , 1 ;Servo 1 inlezen
- Servo2 = Pulsin portb.2 , 1 ;Servo 2 inlezen
- ;|||||||||||||||||||||||Knipperlicht||||||||||||||||||||||
- If servo1 < 120 Then
- High portb.3 ;Knipperlicht 1
- delayms Kniptijd1
- low portb.3
- delayms kniptijd1
- Endif
- If servo1 > 180 Then
- High portb.4 ;Knipperlicht 2
- Delayms Kniptijd1
- low portb.4
- delayms kniptijd1
- endif
- ;|||||||||||||||||||||||Rem & achteruitrijlicht||||||||||||||||||||||
- If servo2 < 140 Then
- high portb.5 ;Remlicht
- delayms Remtijd1
- delayms remtijd1
- low portb.5
- Endif
- goto main
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement