basic语言的基本命令

合集下载
相关主题
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

basic语言的基本命令

Basic command (2009-09-2420:34:02)

Reprint TAB: it classification: compiler authoring

The assign statement (LET) (format) LET variable = the expression (function) assigns a data to a variable. The essay is made out of the basic statement. The value of the expression is the data to be assigned to the variable. The expression can be either a number or an arithmetic. 【 application 】 LET A = 5 (2) suspension of statements (PAUSE) PAUSE time format 】【【 features 】 to suspend execution, or delay for A period of time. 【 description 】 (1) when let robot motion, is to control the robot by the length of time the distance of the forward and backward, and the left and right rotation Angle. The specific value of time is the length of time, which can be accurate to milliseconds. The phrase "PAUSE 1000" means that the delay time is set to 1 second. 3. The END of the statement (END) END format 】【【 features 】 terminates 4. Loop statement (FOR/NEXT) FOR loop variable = initial value TO the final STEP STEP length (...

... The circulatory body

... )

NEXT variable FOR loop statements (circular entrance) NEXT cycle final value statements (cycle export) 【 features 】 do statement used to perform a fixed number of repetitions. The initial value, final value, and step length of the loop variable can be constant or variable. When the STEP length is 1, STEP

can be omitted. It is necessary to use the name of the loop variable. The nested layer of the loop is no more than 8 layers.

The SOUND (SOUND) [function] gives the SOUND of a given tone for the duration of the specified duration. The module has been integrated into port 10 of the general robot motherboard. Voice frequency value, is the actual frequency value, can send out the frequency of the people's ears to hear, in the practical application, can be appropriately changing the frequency of the sound to correct intonation, sound frequency zero for the rest. Unconditional transfer statement (GOTO) (format) the GOTO mark (function) unconditionally moves to the specified row label to execute the program. An article is a symbol for an address. The bidding number is terminated by the colon and appears before the execution statement, not before the non-executable. 7.注释语句(REM)【格式】 REM 字符串【功能】释语句的主要作用是为了增强程序的可读性,在程序执行中并不被执行,即REM”后的语句只是起到说明作用。【说明】⑴ 为了提高程序的可读性,可以在程序的适当位置加上一些注释,注释可以放在程序的任何位置。

⑵ REM后面可以是任何内容。⑶ REM可以用单引号代替“’”。【应用】 REM 机器人走图形 8.条件转移语句(IF/THEN)【格式】IF 条件表达式 THEN 标号【功能】根据条件表达式是否成立,决定程序的流向。【说明】⑴ 在条件语句中,条件表达式的值如果为真,那么转到给定的标号去执行程序,否则执行条件语句的下一个语句。⑵ 在使用条件语句前,要对算术表达式、关系表达式、逻辑表达式以及有关知识有一个初步的了解和认识。① 算术表达式:算术运算符:+(加)、-(减)、*(乘)、/(除)、^(乘方)、(、)圆括号算术表达式:用算术运算符和括号,将常量、变量和函数连接起来的式子。② 关系表达式关系运算符:=(等于)、<>(不等于)、=>或>=(大于等于)、=<或<=(小于等于)、>、(大于)< (小于)。关系表达式的运算结果是一个逻辑值,逻辑值只有两个,真(1)和假(0)。

相关文档
最新文档