⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 deboun.bas

📁 82 sample programs written in BASCOM-8051 for 8051 developement
💻 BAS
字号:
'-----------------------------------------------------
'                 DEBOUN.BAS
'           Demonstrates DEBOUNCE
'-----------------------------------------------------
CONFIG DEBOUNCE = 30  'when the config statement is not used a default of 25mS will be used

  'Debounce P1.1 , 1 , Pr 'try this for branching when high(1)
  Debounce P1.0 , 0 , Pr , Sub
  Debounce P1.0 , 0 , Pr , Sub
  '                    ^----- label to branch to
  '               ^---------- Branch when P1.0 goes low(0)
  '         ^---------------- Examine P1.0

  'When P1.0 goes low jump to subroutine Pr
  'P1.0 must go high again before it jumps again
  'to the label Pr when P1.0 is low

  Debounce P1.0 , 1                       'no branch
  Debounce P1.0 , 1 , Pr                  'will result in a return without gosub
End

Pr:
  Print "P1.0 was/is low"
Return

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -