Example: quiz answers

www.picaxe.com BASIC COMMANDS Section 2 1

Section 2 BASIC COMMANDS revolution(c) Revolution Education : rights 10 !This PDF is designed to be used with the shortcut links (document outline) visible on the left hand these links makes it much easier to navigate through this manual! Section 2 BASIC COMMANDS revolution(c) Revolution Education : rights 10 .. 5 picaxe Software .. 7 Pre-Processor and Directives .. 8 Variables - General .. 13 Variables - Storage .. 14 Variables - Scratchpad .. 15 Variables - System .. 16 Variables - Special function .. 17 Variables - Mathematics .. 25 Variables - Unary Mathematics.

1 1 www.picaxe.com IMPORTANT! This PDF is designed to be used with the shortcut links (document outline) visible on the left hand side. Displaying these links makes it much easier to navigate through this manual! Section 2 BASIC COMMANDS revolution (c) Revolution Education Ltd. Web: www.picaxe.com

Tags:

  Picaxe

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of www.picaxe.com BASIC COMMANDS Section 2 1

1 Section 2 BASIC COMMANDS revolution(c) Revolution Education : rights 10 !This PDF is designed to be used with the shortcut links (document outline) visible on the left hand these links makes it much easier to navigate through this manual! Section 2 BASIC COMMANDS revolution(c) Revolution Education : rights 10 .. 5 picaxe Software .. 7 Pre-Processor and Directives .. 8 Variables - General .. 13 Variables - Storage .. 14 Variables - Scratchpad .. 15 Variables - System .. 16 Variables - Special function .. 17 Variables - Mathematics .. 25 Variables - Unary Mathematics.

2 28 Input / Output Pin Naming Conventions .. 40branch .. 43calibadc (calibadc10) .. 57dec .. 62doze .. 63eeprom (data) .. 66end .. 67exit .. 71get .. 72gosub (call) .. 73goto .. 79hi2csetup - slave mode (X2 parts only) .. 79hi2csetup - master mode .. 84high .. 86high portc .. 89 Section 2 BASIC COMMANDS revolution(c) Revolution Education : rights 10 94hserout .. 97hspiin (hshin) .. 99hspiout (hshout) .. \ \ else \ endif .. {goto} .. {goto}.. 109if {goto} .. 110if {goto} .. exit.

3 Exit .. gosub .. gosub .. 112inc .. 128irout .. 134kbled (keyled) .. 136let .. 137let dirs / dirsc = .. 139let dirsA / dirsB / dirsC / dirsD = .. 140let pins / pinsc = .. 141let pinsA / pinsB / pinsC / pinsD = .. 144low .. 145low portc .. 146nap .. 158poke .. 161pop .. 170put .. 171pwm .. 172pwmduty .. 173pwmout .. 174random .. 177read .. 178readadc .. 179readadc10 .. 180readdac .. 184 Section 2 BASIC COMMANDS revolution(c) Revolution Education : rights 10 .. 186readmem .. 190readrevision.

4 194readowclk .. 195resetowclk .. 203reverse .. 205rfout .. 207run .. 209select case \ case \ else \ endselect .. 216serout .. 228setfreq .. 232shiftin (spiin) .. 234shiftout (spiout).. 241srset / srreset .. 246switch on/off .. 254touch .. 256tune .. 266uniout .. 270writemem .. 272 Appendix 1 - COMMANDS .. 273 Appendix 2 - Additional (non-command) reserved words .. 274 Appendix 3 - Reserved Labels .. 275 Appendix 4 - Possible Conflicting COMMANDS .. 276 Appendix 5 - X2 Variations .. 277 Appendix 6 - M2 Variations.

5 278 Manufacturer Website: .. 279 Trademark: .. 279 Acknowledgements: .. 279 Section 2 BASIC COMMANDS revolution(c) Revolution Education : rights 10 picaxe manual is divided into four sections: Section 1 -Getting StartedSection 2 - BASIC CommandsSection 3 -Microcontroller interfacing circuitsSection 4 -FlowchartsThis second Section provides the syntax (with detailed examples) for all the BASIC COMMANDS supported by the picaxe system. It is intended as a lookup reference guidefor each BASIC command supported by the picaxe system. As some COMMANDS onlyapply to certain size picaxe chips, a diagram beside each command indicates the sizesof picaxe that the command applies using the flowchart method of programming, only a small subset of the availablecommands are supported by the on-screen simulation.

6 These COMMANDS are indicatedby the corresponding flowchart icon by the more general information about how to use the picaxe system, please see Section 1 Getting Started . picaxe SoftwareThe main Windows application used for programming the picaxe chips is called the picaxe Editor . This software is free of charge to picaxe see Section 1 of the manual ( Getting Started ) for installation details andtutorials. Please ensure that you are using the latest version, the software is a freedownload from Editor 6 is also a flowcharting application designed for educational use (itreplaces Logicator).

7 Programs are developed as graphical flowcharts on screen. Theseflowcharts are then automatically converted into BASIC files for download into thePICAXE is a simpler free version of the Programming Editor software for use on theLinux and Mac operating systems. It also supports all the BASIC COMMANDS in VSM is a Berkeley SPICE circuit simulator, which will simulate completeelectronic circuits using picaxe chips. The BASIC program can be stepped through lineby line whilst watching the input/output peripheral react to the latest version of the software is available on the picaxe website you have a question about any command please post a question on the very activesupport forum at this 2 BASIC COMMANDS revolution(c) Revolution Education : rights 10 are used as markers throughout the program.

8 Labels are used to mark aposition in the program to jump to from another position using a goto, gosubor other command. Labels can be any word (that is not already a reservedkeyword) and may contain digits and the underscore character. Labels must startwith a letter or underscore (not digit), and are followed directly by a colon (:) atthe marker position. The colon is not required within the actual compiler is not case sensitive (lower and/or upper case may be used at anytime).Example:main:high ; switch on output 1pause 5000 ; wait 5 secondslow ; switch off output 1pause 5000 ; wait 5 secondsgoto main ; loop back to startWhitespaceWhitespace is the term used by programmers to define the white area on aprintout of the program.

9 This involves spaces, tabs and empty lines. Any of thesefeatures can be used to space the program to make it clearer and easier to is convention to only place labels on the left hand side of the screen. All othercommands should be indented by using the tab key . This convention makes theprogram much easier to read and are normally placed on separate lines. However if desired the colon(:) character can be use to separate multiple COMMANDS on a single line pin1 = 1 then : high 1 : else : low 1 : endifLine continuationLong lines can be continued onto a second line by using an underscore pin1 = 1 then gosub _label1.

10 Continued on second lineCode CollapsingOn long programs in Programming Editor the { and } brackets can be used tocollapse ( hide ) sections of code to make programs clearer { high 1}CommentsComments are used to add information into the program for future are completely ignored by the computer during a download. Commentsbegin with an apostrophe ( ) or semicolon (;) and continue until the end of theline. The keyword REM may also be used for a comment. Section 2 BASIC COMMANDS revolution(c) Revolution Education : rights 10 lines can be commented by use of the #REM and #ENDREM :high 0 ; make output 0 highlow 0 REM make output 0 low#rem ; #rem out a number of lineshigh 0pause 2000#endremConstantsConstants are fixed numbers that are used within the program.


Related search queries