📄 ex17 - freqin1.bs2
字号:
' {$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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -