PICAXE
PICAXE | |
Download SW: PICAXE PICAXE AXEpad Tutoriály:
|
Tasks | |
-
PICAXE - vývojová deska
-
PICAXE - popis vývojové desky
-
PICAXE - blokové schéma
-
PICAXE - schéma vývojové desky
-
Robot Umík
-
Umík - popis
-
Umík - blokové schéma
-
Schéma zapojení robota Umíka
-
Deska plošných spojů
-
Blik
-
DICE
-
2x IN, 2 x OUT
Náměty:
PICAXE8 LED |
init:
let b0 = 0
main:
if pin3 = 1 then add 'i/o pin 3 = physical ic pin 4
if pin3 = 0 then low 1
endif
goto main
add:
pause 100
let b0 = b0 + 1
if b0 < 5 then main
high 1 'i/o pin 1 = physical pin 6
goto main
|
PICAXE81 |
[ info] |
LED blikání |
main:
low 0 ' PIN 0 set OFF, LED will be shine
' linka 0 se vynuluje, LED bude svítit
pause 500 ' wait 500 ms/ čekání 500 ms
high 0 ' PIN 0 set ON, LED will not be shine
' linka 0 se nastavi do log. "1", LED nebude svítit
pause 500 ' čekání 200 ms
GOTO main 'jump to label main
'skok na návěští main
|
Běžící had |
pins = %11111111 ;zhasne všechny diody
main:
pause 1000 ' čekání 1 000 ms = 1 s
low 0 ' linka 0 se vynuluje log. "0"
pause 200 ' čekání 200 ms
high 0 ' linka 0 se nastavi do log. "1"
low 1 pause 200 high 1 'dále postupně přepíná s 200 ms pauzou
low 2 pause 200 high 2
low 3 pause 200 high 3
low 4 pause 200 high 4
low 5 pause 200 high 5
low 6 pause 200 high 6
low 7 pause 200 high 7
goto main 'skok na návěští main
|
Robot Umík |
je postaven na podvozku UMU-01 Lze sestavit v konfiguraci stopař pro sledování čáry nebo minisumo
|
PICAXE MICROCONTROLLERS | |
PICAXE02 |
init: b2 = 0 ' reset targetbyte before the loop
' input C.0, active high, jump to ‘pushed’ label when = 1
myloop: button C.0,1,200,100,b2,1,pushed ' jump to cont when C.0 = 1
low B.7 ' output off
pause 10 ' loop delay time
goto myloop
pushed: high B.7 ' output on
goto myloop
|
Push Switch |
init: let b0 = 0
main: if pinC.7 = 1 then add
low B.7
goto main
add: pause 100 'short delay
let b0 = b0 + 1
if b0 < 5 then main
high B.7
goto main
|
For..Next |
symbol counter = b0 'define the variable counter
symbol dp = 7 'define pin 7 with the name dp
main:
for counter = 1 to 15 'start a for...next loop
high dp 'switch pin 7 high
pause 500 'wait for 0.5 second
low dp 'switch pin 7 low
pause 500 'wait for 0.5 second
next counter 'end of for...next loop
end 'end program
|
PICAXE03 |
symbol counter = b0 'define the variable counter
symbol dp = 7 'define pin 7 with the name dp
main:
FOR counter = 1 TO 20 'start a for...next loop
pins = %11000000 ' symbol 0
pause 100 'wait for 0.1 second
pins = %11111001 ' symbol 1
pause 100
pins = %10010100 ' symbol 2
pause 100
pins = %10001111 ' symbol 3
pause 100
pins = %10011001 ' symbol 4
pause 100
pins = %11101101 ' symbol 5
pause 100
NEXT counter 'end of for...next loop
END
[ info] |
PICAXE04 |
symbol counter = b0 'define the variable counter
symbol dp = 7 'define pin 7 with the name dp
w1 = %00000000
main:
FOR counter = 1 TO 255 'start a for...next loop
pins = w1 'start
pause 100 'wait for 0.1 second
w1 = w1 + 1 'incrementace
NEXT counter 'end of for...next loop
END
[ info] |
Counter |
rst:
w1 = %00000000
pins = w1
main: if pinC.6 = 1 then rst
if pinC.7 = 1 then add
goto main
add: pause 50 ' short delay
let b0 = b0 + 1
if b0 < 5 then main
pins = w1 ' symbol 0
w1 = w1 + 1
goto main
end
[ info] |
Servo |
servo 4, 150 ' start servo on pin four and move to center
main:
pause 500 ' wait a half second
servopos 4, 200 ' move servo clockwise
pause 500 ' wait a half second
servopos 4, 150 ' move servo to center
pause 500 ' wait a half second
servopos 4, 100 ' move servo counter-clockwise
pause 500 ' wait a half second
servopos 4, 150 ' move servo to center
goto main ' return to main program loop
|