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

📄 ex02 - blink2.bs2

📁 proteus得一些经典例子
💻 BS2
字号:
' {$STAMP BS2}
' ==============================================================================
'
' File...... Ex02 - Blink2.BS2
' Purpose... LED Blinker - Version 2
' Author.... Parallax
' E-mail.... stamptech@parallaxinc.com
' Started...
' Updated... 01 MAY 2002
'
'
' ==============================================================================
' ------------------------------------------------------------------------------
' Program Description
' ------------------------------------------------------------------------------
' Blinks an LED connected to Pin 0. LED on-time and off-time can be set
' independently of each other.
' ------------------------------------------------------------------------------
' I/O Definitions
' ------------------------------------------------------------------------------
MyLED VAR Out0 ' LED connected to Pin 0
' ------------------------------------------------------------------------------
' Constants
' ------------------------------------------------------------------------------
DelayOn CON 1000 ' on-time time in milliseconds
DelayOff CON 250 ' off-time in milliseconds
On CON 1
Off CON 0
' ------------------------------------------------------------------------------
' Initialization
' ------------------------------------------------------------------------------
Initialize:
Dir0 = %1 ' make LED pin an output
' ------------------------------------------------------------------------------
' Program Code
' ------------------------------------------------------------------------------
Main:
MyLED = On
PAUSE DelayOn ' pause for "on" time
MyLED = Off
PAUSE DelayOff ' pause for "off" time
GOTO Main ' do it again
END

⌨️ 快捷键说明

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