User Tools

Site Tools


wiki:ostatni:picaxe:start

This is an old revision of the document!


PICAXE

Napájení

  • 4.5 - 5.5 V

  • pinsB - the portB input pins
  • outpinsB - the portB output pins
  • dirsB - the portB data direction register
  • pinsC - the portC input pins
  • outpinsC - the portC output pins
  • dirsC - the portC data direction register

Nastaveni pinu 7,6=1, 5,4,3,2,1,0=0 :

let outpinsB = %11000000

Nacteni stavu vstupnich pinu do promene:

let b1 = pinsB

Promenne vstupnich pinu:

pinsB = pinB.7 : pinB.6 : pinB.5 : pinB.4 : pinB.3 : pinB.2 : pinB.1 : pinB.0

Promenne vystupnich pinu:

outpinsB = outpinB.7 : outpinB.6 : outpinB.5 : outpinB.4 : outpinB.3 : outpinB.2 : outpinB.1 : outpinB.0
symbol counter = b1   ; define the variable b1 as “counter”
symbol LED = B.4      ; define pin 4 with the name “LED”

main:
   for counter = 1 to 15    ;start a for...next loop
   high LED                 ;switch pin 4 high
   pause 500                ;wait for 0.5 second
   low LED                  ;switch pin 4 low
   pause 500                ;wait for 0.5 second
next counter                ;end of for...next loop

end                         ;end program
wiki/ostatni/picaxe/start.1484773824.txt.gz · Last modified: 2017/01/18 22:10 by root