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

📄 input.bas

📁 82 sample programs written in BASCOM-8051 for 8051 developement
💻 BAS
字号:
'--------------------------------------------------------------
'                 (c) 1997-2001 MCS Electronics
'--------------------------------------------------------------
'  file: INPUT.BAS
'  demo: INPUT, INPUTHEX
'--------------------------------------------------------------
'To use another baudrate and crystalfrequency use the
'metastatements $BAUD =  and $CRYSTAL =
$baud = 1200                                                  'try 1200 baud for example
$crystal = 12000000                                           '12 MHz

'---------------------------------------------------------------
'   When you need that the program times out on waiting for a character
'   you need to use the TIMEOUT option.
'   When the charcter is not received within the specified time ERR will be set to 1
'   otherwise ERR will be 0.
'   IMPORTANT : the TIMEOUT variable will use 4 bytes of internal memory
'---------------------------------------------------------------

Dim V As Byte , B1 As Byte
Dim C As Integer , D As Byte
Dim S As String * 15                                          'only for uP with XRAM support

Input "Use this to ask a question " , V
Input B1                                                      'leave out for no question

Input "Enter integer " , C
Print C


Inputhex "Enter hex number (4 bytes) " , C
Print C
Inputhex "Enter hex byte (2 bytes) " , D
Print D

Input "More variables " , C , D
Print C ; " " ; D

Input C Noecho                                                'supress echo

Input "Enter your name " , S
Print "Hello " ; S

Input S Noecho                                                'without echo
Print S

'unremark next line and remark all lines above for the TIMEOUT option
'this because when you use TIMEOUT once, you need to use it for all INPUT statements
'Input "Name " , S Timeout = 0
'Print Err ; " " ; s
End

⌨️ 快捷键说明

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