Advertisement
mike2545

Button

Nov 24th, 2013
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QBasic 0.74 KB | None | 0 0
  1.          INCLUDE "modedefs.bas"
  2. INCLUDE "ALLDIGITAL.pbp"
  3. DEFINE OSC 4
  4.  
  5. OSCCON = $60    ' Clock speed
  6.  
  7. DEFINE DEBUG_REG PORTB
  8.     DEFINe DEBUG_BIT 4
  9.    
  10.     define DEBUG_BAUD 9600
  11.     define DEBUG_MODE 1
  12.  
  13. '-----------Variables--------------------------------------------
  14. Btn VAR portb.0
  15.  
  16. btnWrk  VAR Byte
  17.  
  18. Main:
  19.  
  20. '   Try changing the delay value (200) in BUTTON to see the effect
  21. '   of its modes: 0 = no delay; 1 - 254 = varying delays before
  22. '   auto-repeat;
  23. '   255 = no auto-repeat (only on action per button press)
  24. '
  25. '   The BUTTON instruction will cuase the program to branch to
  26. '   Press when the button is pressed
  27.  
  28. PAUSE 5
  29. BUTTON Btn,0, 200, 20, btnWrk,1, Press
  30. GOTO main
  31.  
  32. Press:
  33.      DeBUG "*"
  34.     GOTO Main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement