PBASIC 2.5 PBASIC 2.5 $PBASIC directive PIN type New DEBUG control characters DEBUGIN Line continuation for comma-delimited lists IF THEN ELSE * SELEC

Similar documents
syspro-0405.ppt

PICマイコンボード カタログ:テック・ハンゾウガネ

コンピュータ概論

コンピュータ概論

Introduction Purpose This training course demonstrates the use of the High-performance Embedded Workshop (HEW), a key tool for developing software for

Technische Beschreibung P82R SMD

Compatibility list: vTESTstudio/CANoe

第10回 コーディングと統合(WWW用).PDF

Version 1.2 Parallax Inc.

AN 100: ISPを使用するためのガイドライン

,,,,., C Java,,.,,.,., ,,.,, i

PDW-75MD

.NETプログラマー早期育成ドリル ~VB編 付録 文法早見表~

ワイヤレス~イーサネットレシーバー UWTC-REC3

compiler-text.dvi

untitled

TF Editor V3.5 ユーザーガイド

listings-ext

25 II :30 16:00 (1),. Do not open this problem booklet until the start of the examination is announced. (2) 3.. Answer the following 3 proble

DV-RA1000HD_Jpn(b)

Smalltalk_

MIFES Ver.7.0 マクロマニュアル

mbed_library_study_meeting_v1.0.key

GM-F520S/GM-F470S/GM-F420S

Windows Cygwin Mac *1 Emacs Ruby ( ) 1 Cygwin Bash Cygwin Windows Cygwin Cygwin Mac 1 Mac 1.2 *2 ls *3 *1 OS Linux *2 *3 Enter ( ) 2

RT300i/RT140x/RT105i 取扱説明書

1

PR300 電力モニタ 通信インタフェース (RS-485通信,Ethernet通信)

WAGO Profibus /-833及び三菱MELSEC Q02HCPU/QJ71PB92Dのコンフィグレーション

BASICとVisual Basic

TOPLON PRIO操作手順

TF Editor V4.0 ユーザーガイド

DA100データアクイジションユニット通信インタフェースユーザーズマニュアル

RT300/140/105シリーズ 取扱説明書

lifedesign_contest_No3

oxygen49-61_userguide

45 VBA Fortran, Pascal, C Windows OS Excel VBA Visual Basic Excel VBA VBA Visual Basic For Application Microsoft Office Office Excel VBA VBA Excel Acc

Arduino UNO IS Report No. Report Medical Information System Laboratory

Nios II 簡易チュートリアル

Lesson 1 1 EXVBA2000 Lesson01 Lesson01.xls 2

untitled


Łñ“’‘‚2004

プリント

untitled

Emacs Ruby..

総合的な経済・エネルギー・環境分析に資する技術情報の整備のための研究


液晶プロジェクター CP-S317J/X327J 取扱説明書

プリント

OS Windows Mac OS Windows Mac OS Windows XP Mac OS X OS Windows 95 Mac OS

Ver.1 1/17/2003 2

Microsoft Word - Win-Outlook.docx

CDR1000_J

program.dvi

RR-US470 (RQCA1588).indd

Kumagai09-hi-2.indd

I ASCII ( ) NUL 16 DLE SP P p 1 SOH 17 DC1! 1 A Q a q STX 2 18 DC2 " 2 B R b

For_Beginners_CAPL.indd

N88 BASIC 0.3 C: My Documents 0.6: 0.3: (R) (G) : enterreturn : (F) BA- SIC.bas 0.8: (V) 0.9: 0.5:

PMW-PZ1

Introduction Purpose This training course describes the configuration and session features of the High-performance Embedded Workshop (HEW), a key tool

(CC Attribution) Lisp 2.1 (Gauche )

TeraTerm Pro V.2.32の利用法

ストラドプロシージャの呼び出し方

midicontrolsurfaces60_J.book

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV

学校では教えてくれないアセットバンドル

SCM (v0201) ( ) SCM 2 SCM 3 SCM SCM 2.1 SCM SCM SCM (1) MS-DOS (2) Microsoft(R) Windows 95 (C)Copyright Microsoft Corp


Microsoft PowerPoint - C_Programming(3).pptx

quattro.PDF

Moji3 API

bc0710_010_015.indd

tuat1.dvi

Microsoft Word - SU1204教本(Driver)原稿.docx

Ruby Ruby ruby Ruby G: Ruby>ruby Ks sample1.rb G: Ruby> irb (interactive Ruby) G: Ruby>irb -Ks irb(main):001:0> print( ) 44=>

CM1-GTX

untitled

JavaScript の使い方

User Manual, Anybus Communicator for DeviceNet

¥×¥í¥°¥é¥ß¥ó¥°±é½¬I Exercise on Programming I [1zh] ` `%%%`#`&12_`__~~~ alse

UA-700_j

Java演習(4) -- 変数と型 --

# let rec sigma (f, n) = # if n = 0 then 0 else f n + sigma (f, n-1);; val sigma : (int -> int) * int -> int = <fun> sigma f n ( : * -> * ) sqsum cbsu

Pascal Pascal Free Pascal CPad for Pascal Microsoft Windows OS Pascal

解きながら学ぶJava入門編

74 No ACCESS

MQTT V3.1 プロトコル仕様

PowerPoint プレゼンテーション

untitled

LiveCode初心者開発入門サンプル

1 Code Generation Part I Chapter 8 (1 st ed. Ch.9) COP5621 Compiler Construction Copyright Robert van Engelen, Florida State University,

FreeBSD 1

10 (1) s 10.2 rails c Rails 7 > item = PlanItem.new => #<PlanItem id nil, name nil,...> > item.name = "" => "" > item.valid? => true valid? true false

: gettoken(1) module P = Printf exception End_of_system (* *) let _ISTREAM = ref stdin let ch = ref ( ) let read () = (let c =!ch in ch := inp


1

TH-42PAS10 TH-37PAS10 TQBA0286

A/B (2010/10/08) Ver kurino/2010/soft/soft.html A/B

Transcription:

PBASIC 2.5 PBASIC 2.5 BASIC Stamp Editor / Development System Version 2.0 Beta Release 2 2.0 PBASIC BASIC StampR PBASIC PBASIC PBASIC 2.5 Parallax, Inc. PBASIC 2.5 PBASIC 2.5 support@microbot-ed.com 1

PBASIC 2.5 PBASIC 2.5 $PBASIC directive PIN type New DEBUG control characters DEBUGIN Line continuation for comma-delimited lists IF THEN ELSE * SELECT CASE DO LOOP EXIT to terminate loops 10 ON GOSUB 11 ON GOTO 12 READ / WRITE enhanced 13 PUT / GET enhanced * 14 Program labels require colon 15 Conditional Compilation Directives * 16 Enhanced Interface / Color Syntax Highlighting * $PBASIC Directive Directive Version Compile PBASIC PBASIC 2.0 2.5 ' {$PBASIC 2.0} ' 2.0 ' {$PBASIC 2.5} ' version 2.5 2 PBASIC PIN Type Type I/O PIN I/O input output input In output Out ******************************************************************* SDA PIN 8 SCL PIN 9 I2C_Start: 2

PBASIC 2.5 INPUT SDA INPUT SCL LOW SDA ' make pins inputs Clock_Hold: DO LOOP WHILE (SCL = 0) RETURN ' monitor input bit *************************************************************** DEBUG BASIC Hyper Terminal CRSRXY X Y X Y CRSRLF CRSRRT CRSRUP CRSRDN LF 10 Linefeed character CLREOL 11 CLRDN 12 CRSRX 14 X X CRSRY 15 Y Y DEBUG CRSRXY, 1, 1 DEBUG "BASIC Stamp Editor Version 2.0", CR ********************************************************************************* 2 2 CRSRXY 1 1 DEBUGIN DEBUG DEBUGIN SERIN PIN 16 baud rate DEBUG 9600 modifiers DEBUGIN DEBUG SERIN SEROUT 3

PBASIC 2.5 ******************************************************************************** Get_Hours: DEBUG Home, "Enter hours: ", CLREOL DEBUGIN DEC hrs IF (hrs > 23) THEN Get_Hours ********************************************************************************* DEBUGIN DEBUG Echo Off 2 ******************************************************************************** DEBUG "Hello, World", CR, "PBASIC 2.5 is ready for action!" BRANCH idx, [Target1, Target2, Target3, Target4, Target5, Target5] SELECT idx CASE 1, 2, 6, 10, 11, 12 HIGH 0 CASE 3, 4, 5, 13, 14, 15 HIGH 1 ENDSELECT ******************************************************************************** IF THEN ELSE PBASIC 2.5 IF THEN ELSE 2 ***************************************************************** IF condition THEN statement(s) { ELSEIF condition THEN statement(s) } { ELSE statement(s) } ENDIF ***************************************************************** 4

PBASIC 2.5 ENDIF IF condition THEN statement(s) { ELSEIF statement(s) } { ELSE statement(s) } 1 THEN ELSEIF ELSE ENDIF 1 IF THEN ELSE 16 nest ************************************************************************** IF (score > 90) THEN DEBUG "Your grade is an A!", CR ELSE DEBUG "Perhaps more study is in order...", CR ENDIF IF (idx = 1) THEN HIGH 10 : LOW 11 ELSE LOW 10 : HIGH 11 ************************************************************************** SELECT CASE IF THEN ELSE SELECT CASE SELECT CASE PBASIC ******************************************************** SELECT expression CASE condition ELSE statement(s) ENDSELECT ******************************************************** expression expression condition condition op # condition op # expression #TO# 5

PBASIC 2.5 CASE CASE True CASE ENDSELECT ****************************************************** SELECT ircmd CASE 0 TO 3 HIGH ircmd CASE AllOff, Mute OutA = %0000 CASE ELSE DEBUG "Bad Command", CR ENDSELECT ******************************************************* DO LOOP PBASIC 2.5 DO { WHILE UNTIL condition } statement(s) LOOP { UNTIL WHILE condition } True 16 DO LOOP Nested *********************************************************** DO TOGGLE PAUSE LOOP ************************************************************ DO WHILE (Status = Okay) StatusLED = IsOn PAUSE 100 LOOP ************************************************************ 6

PBASIC 2.5 ******************************************************** DO AlarmLED = IsOn PAUSE 1000 LOOP UNTIL (oventemp < ResetThreshold) ******************************************************** EXIT EXIT FOR NEXT DO LOOP 16 EXIT *************************************** FOR samples = 1 TO 10 GOSUB Read_Temp GOSUB Display_Temp IF (temp > 100) THEN EXIT PAUSE 1000 NEXT *************************************** temp 100 10 temp 100 FOR NEXT 10 ON GOSUB ON GOSUB BASIC PBASIC BRANCH GOSUB ON offset GOSUB Target0 {, Target1, Target2,...TargetN } offset N index 255 ON GOSUB 255 7

PBASIC 2.5 ********************************************************************** DO ON task GOSUB Update_Motors, Read_IR, Read_Light, Read_Temp task = task + 1 // NumTasks LOOP ********************************************************************** 11 ON GOTO ON GOTO BASIC PBASIC BRANCH ON offset GOTO Target0 {, Target1, Target2,...TargetN } offset N index 255 ON GOSUB 255 ON alarmlevel GOTO Code1, Code2, Code3 BRANCH BRANCH alarmlevel, [Code1, Code2, Code3] 12 READ and WRITE READ WRITE Bytes Words 1 READ WRITE READ location, {Word} variable {, {Word} variable, {Word} variable... } WRITE location, {Word} variable {, {Word} variable, {Word} variable... } READ 0, hours, minutes, seconds WRITE 3, month, day, Word year Word low byte high byte 8

PBASIC 2.5 13 PUT and GET PUT GET Bytes Words 1 PUT GET PUT location, {Word} variable {, {Word} variable, {Word} variable... } GET location, {Word} variable {, {Word} variable, {Word} variable... } PUT 0, hours, minutes, seconds GET 3, month, day, Word year Word low byte high byte 14 PBASIC 2.5 GOTO BRANCH Get_Hours: ' good label DEBUG Home, "Enter hours: ", CLREOL DEBUGIN DEC hrs IF (hrs > 23) THEN Get_Hours Get_Mins ' illegal label DEBUG Home, "Enter minutes: ", CLREOL DEBUGIN DEC mins IF (mins > 59) THEN Get_Mins ****************************************************************************************** 15 BASIC #DEFINE symbol = value 9

PBASIC 2.5 #DEFINE NOSPRAM = ($STAMP = BS2) #IF (condition) #THEN statement(s) { #ELSE statement(s) } #ENDIF ***************************************** #IF (NOSPRAM) #THEN DEBUG "No SPRAM in this Stamp." END #ENDIF #SELECT expression #CASE condition statement(s) #ENDSELECT ***************************************** #SELECT $STAMP #CASE BS2, BS2e, BS2pe MidiBaud CON $8000 + 12 #CASE BS2sx, BS2p MidiBaud CON $8000 + 60 #ENDSELECT #ERROR message ****************************************** editor #ERROR #IF ($STAMP = BS2) #THEN #ERROR "No SPRAM in this Stamp." #ENDIF ****************************************** 10

PBASIC 2.5 BS2 BASIC 16 BASIC Edit\Preferences Preferences Editor Appearance PBASIC scheme Copy Scheme approve Show Preview Example 11