12.07.2015 Views

PICAXE Manual Section 1 - TechnoPujades - Free

PICAXE Manual Section 1 - TechnoPujades - Free

PICAXE Manual Section 1 - TechnoPujades - Free

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

www.picaxe.co.uk<strong>Section</strong> 1 49GETTING STARTED<strong>PICAXE</strong>-28 / 28A / 28X SFRpins(out)pinsinfrakeyvalue= the input port when reading from the port= the output port when writing to the port= a separate variable used within the infrain command= 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 : pin5 : pin4 : pin3 : pin2 : pin1 : pin0The variable outpins is broken down into individual bit variables for writingoutputs directly. Only valid output pins are implemented.outpins = outpin7 : outpin6 : outpin5 : outpin4 :outpin3 : out pin2 : outpin1 : outpin0revolution(c) Revolution Education Ltd. Email: info@rev-ed.co.uk Web: www.rev-ed.co.ukVersion 6.9 07/2009All rights reserved.49

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!