ex17 - freqin1.bs2

来自「proteus得一些经典例子」· BS2 代码 · 共 38 行

BS2
38
字号
' {$STAMP BS2}
' ==============================================================================
'
' File...... Ex17 - FreqIn1.BS2
' Purpose... Frequency input
' Author.... Parallax
' E-mail.... stamptech@parallaxinc.com
' Started...
' Updated... 01 MAY 2002
'
'
' ==============================================================================
' ------------------------------------------------------------------------------
' Program Description
' ------------------------------------------------------------------------------
' This program monitors and displays the frequency of a signal on Pin 0.
' ------------------------------------------------------------------------------
' I/O Definitions
' ------------------------------------------------------------------------------
FreqPin CON 0 ' frequency input pin
' ------------------------------------------------------------------------------
' Constants
' ------------------------------------------------------------------------------
OneSec CON 1000 ' one second - BS2
' OneSec CON 2500 ' BS2sx
' OneSec CON 3484 ' BS2p
' ------------------------------------------------------------------------------
' Variables
' ------------------------------------------------------------------------------
freq VAR Word ' frequency
' ------------------------------------------------------------------------------
' Program Code
' ------------------------------------------------------------------------------
Main:
COUNT FreqPin, OneSec, freq ' collect pulses for 1 second
DEBUG CLS, "Frequency: ", DEC freq, " Hz", CR ' display on DEBUG screen
GOTO Main ' do it again
END

⌨️ 快捷键说明

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