UsingBASIC
Afterdriversandlinkinstallation, BASICmaybe
used.TodothatsimplytypeBASIC
HELPcommandshowstheon-linehelp forBASIC
430
Shortprogramsmaybetyped in toquicklytest
workingfunctions
Theaboveexample printnumbersfrom1to7tothe
LCD, thenchangesfont,readtemperaturefromthe
sensoranddisplayit.
Itispossible tosavesample usingSAVE0
commandthenreloadit using LOAD0.
BASICcommandlist
CLEAR-Erasevariablesonly
NEW-Eraseprogramand variables
MEM-Showmemoryusage
END-Terminateprogramwithnomessage
REM-Comment...reminderof lineisignored
RUN [line]-Run program
STOP-Terminateprogram& issuemessage
LIST[start,[end]]-Listprogramlines
BEEP freq,ms-GenerateaBEEP on the buzzer
DELAY ms-Delayfortheindicated time(resolution
1/100sec.)
DATA-Enter\"inline\"datastatements
ORDERline-Positiondatareadpointer
READvar[,var...]-Read datafromprogramstatements
FORv=initTOlimit [STEP increment]-Performacounted loop
NEXT[v]-End counted loop
ONTIME line -Call asubroutineevery1/10 second
GOTOline-Jumptoline
GOSUBline -Call asubroutine
RETURN-Returnfromsubroutine
IFtestTHENline -Conditionalgoto
IFtestTHENstatement-Conditionalstatement(nextstatement
only)
LIFtestTHENstatements-LONGIF(allstatementstoend of
line)
INPUTvar-Getvalueforvariable
INPUT\"prompt\",var-Getvalueofvariablewithprompt
GETS0-GetcharacterfromSerial0
GETS1-GetcharacterfromSerial1
BAUDS0baud-Setbaudforserial0
BAUDS1baud-Setbaudforserial1
LET(default)-variable=expression
DIR-ShowprograminEeprom
SAVE [number]-SaveprogramtoEeprom
LOAD[number]-Load programfromEeprom
USING\"format\"-Printusethespecified 'format'
PRINTexpr[,expr...] -Printtoconsole
PRINTS0expr[,expr...]-PrinttoSerial0
PRINTS1expr[,expr...]-PrinttoSerial1
PEEK(add)-Read a8bitsvaluefromspecified address
PEEKW(add)-Read a16 bitsvaluefromspecified
address
POKE add,expr-Write8bitsvaluetothespecified address
POKEWadd,expr-Write16 bitsvaluetothespecified address
BREAKvalue -AllowtobreaktheprogramwithCTRL-C
LCDStatements:
LCDCLEARvalue-CleartheLCDwiththespecified pattern
LCDMODEvalue-SpecifyifSET(0),RESET(1)orXOR(2)the
pixel
GOTOXY valuex,valuey-Setcursoratspecifiedposition
PIXELvaluex,valuey-Drawapixel
LINETOvaluex,valuey-Drawalineusingcursorasorigin
LCDFONTvalue -Selectaspecified font
LCDPRINTexpr[,expr..] -PrinttoLCD
BACKLIGHTvalue-SwitchON/OFFtheLCDbacklight
HELP [lines]-showthishelp
EXIT-TerminateBASIC-430
Operators:
+-Addition,string concatenation
--Unaryminus,subtraction
*,/, %-multiplication, division, modulus
^-raisetothe power
AND,OR,XOR-AND,OR,eXclusiveOR
<<,>>-Shift left,Shiftright
=,<>-Assign/testequal,testNOTequal(numor
string)
<,<=, >, >= -LT,LE, GT, GE(numbersonly)
! -UnaryNOT
Functions:
CHR$(value)-Returnscharacterofpassed value
STR$(value)-ReturnsASCII string of value'sdigits
ASC(char)-Returnsvalueof passed character
NUM(string)-Convertstring tonumber
ABS(value)-Returnsabsolutevalueofargument
RND(value)-Returnsrandomnumberfrom0to(value-1)