PICAXE Manual Section 1 - TechnoPujades - Free
PICAXE Manual Section 1 - TechnoPujades - Free
PICAXE Manual Section 1 - TechnoPujades - Free
- No tags were found...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
www.picaxe.co.uk<strong>Section</strong> 1 48GETTING STARTED<strong>PICAXE</strong>-18 / 18A / 18M / 18X SFRpins = the input port when reading from the port(out)pins = the output port when writing to the portinfra = a separate variable used within the infrain commandkeyvalue = another name for infra, used within the keyin commandNote that pins is a ‘pseudo’ variable that can apply to both the input and outputport.When used on the left of an assignment pins applies to the ‘output’ port e.g.let pins = %11000011will switch outputs 7,6,1,0 high and the others low.When used on the right of an assignment pins applies to the input port e.g.let b1 = pinswill load b1 with the current state of the input port.Additionally, note thatlet pins = pinsmeans ‘let the output port equal the input port’To avoid this confusion it is recommended that the name ‘outpins’ is used is thistype of statement e.g.let outpins = pinsThe variable pins is broken down into individual bit variables for reading fromindividual inputs with an if...then command. Only valid input pins areimplemented.pins= pin7 : pin6 : x : x : x : pin2 : pin1 : pin0The variable outpins is broken down into individual bit variables for writingoutputs directly. Only valid output pins are implemented.revolution(c) Revolution Education Ltd. Email: info@rev-ed.co.uk Web: www.rev-ed.co.ukVersion 6.9 07/2009All rights reserved.48