Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. DEVICE 16F628A                ;We gebruiken een 16F628A type
  2. CONFIG INTRC_OSC_NOCLKOUT, WDT_OFF, PWRTE_ON, LVP_OFF, MCLRE_OFF
  3. ALL_DIGITAL TRUE              ;Alle ingangen digitaal
  4.  
  5. DIM Servo1 as byte
  6. dim servo2 as byte
  7. Dim teller as byte
  8. dim Teller1 as byte
  9. Symbol Kniptijd1 = 350
  10. Symbol Remtijd1 = 500
  11.  
  12. Main:
  13. ;|||||||||||||||||||||||Knipperlicht||||||||||||||||||||||      
  14.  
  15. For teller = 0 to 50
  16.  
  17.     if teller = 35 then
  18.         goto eind
  19.     endif
  20.        
  21.     Servo1 = Pulsin Portb.1 , 1    ;Servo 1 inlezen
  22.     Servo2 = Pulsin portb.2 , 1    ;Servo 2 inlezen
  23.  
  24.         if servo1 > 121 and servo1 < 179 then
  25.             low portb.3
  26.             low portb.4            
  27.         endif
  28.        
  29.         If servo1 < 120 Then
  30.             toggle portb.3 ;Knipperlicht 1
  31.             delayms 100
  32.         Endif
  33.                
  34.         If servo1 > 180 Then
  35.             toggle portb.4 ;Knipperlicht 2
  36.             delayms 100
  37.         endif
  38.        
  39.     if servo2 < 140 then
  40.         high portb.5
  41.     endif
  42.  
  43. next
  44.  
  45. Goto main
  46.  
  47. Eind:
  48.         low portb.3
  49.         low portb.4
  50.         low portb.5
  51.         low portb.6
  52.         teller = 0
  53.  
  54. goto main              
  55.  
  56. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement