PICAXE: Porovnání verzí
Skočit na navigaci
Skočit na vyhledávání
Založena nová stránka: Úkol pro Vlastu Hanzala zdroj informací: Robot Revue |
Bez shrnutí editace |
||
(Není zobrazeno 30 mezilehlých verzí od 2 dalších uživatelů.) | |||
Řádek 1: | Řádek 1: | ||
{| class="toccolours" cellpadding="5" style="float: right; clear: right; margin: 0 0 1em 1em; font-size: 85%; width: 30em" | |||
| colspan="2" style="text-align: center; font-size: larger; background-color: lightgreen;" | '''''PICAXE''''' | |||
|- style="vertical-align: top;" | |||
| | |||
Download SW: | |||
[https://picaxe.com/software/obsolete/picaxe-programming-editor/index.html PICAXE] | |||
[http://www.picaxe.com/Software/PICAXE/PICAXE-Programming-Editor/ PICAXE] | |||
[http://www.picaxe.com/Software/PICAXE/AXEpad/ AXEpad] | |||
Robot | Tutoriály: | ||
* [[Soubor:programujte.jpg|200px|link=http://programujte.com/clanek/2010082700-programovani-picaxe-uvod/]] | |||
[http://programujte.com/clanek/2010082700-programovani-picaxe-uvod/ Programování PICAXE] | |||
* [[Soubor:Icon-pdf.gif]] [[:Media:PICAXE-2-220_man_cz.pdf|PICAXE – příručka programátora]] [http://www.hobbyrobot.cz/PDF/PICAXE_basic_man_cz.pdf mirror] | |||
* [[Soubor:hobbyrobot.jpg|200px|link=http://www.hobbyrobot.cz/mikrokontrolery/prikazy-jazyka-basic/]] | |||
[http://www.hobbyrobot.cz/mikrokontrolery/prikazy-jazyka-basic/ Syntaxe jazyka BASIC] | |||
* [[PICAXE - BASIC commands]] | |||
* [http://www.joliebrisemodels.co.uk/picaxe/ PICAXE - Microprocessor Tutorial] | |||
{{#widget:YouTube|id=fRvAgDKbAD0|height=180|width=240|Popis|right}} | |||
{{#widget:YouTube|id=_veeeMj-64Q|height=180|width=240|Popis|right}} | |||
|} | |||
{| class="toccolours" cellpadding="5" style="float: right; clear: right; margin: 0 0 1em 1em; font-size: 85%; width: 30em" | |||
| colspan="2" style="text-align: center; font-size: larger; background-color: lightgreen;" | '''''Tasks''''' | |||
|- style="vertical-align: top;" | |||
| | |||
# [http://www.linuxsoft.cz/article.php?id_article=1971 Posuvný bod] | |||
# [http://www.linuxsoft.cz/article.php?id_article=1971 Změna jasu diody] | |||
# [http://www.bristolwatch.com/picaxe/picaxe_led_display.htm Using 7-Segment Displays] | |||
# [http://www.bristolwatch.com/picaxe/74hc164_demo.htm Using the 74HC165 Shift Register] | |||
# [http://www.bristolwatch.com/picaxe/picaxe_h_bridge.htm H-Bridge DC Motor Control] | |||
# [http://www.bristolwatch.com/picaxe/myservo.htm Connecting a Servo] | |||
# [[Soubor:Icon-pdf.gif]] [http://www.picaxe.com/docs/axe105.pdf ELECTRONIC DICE] | |||
# [[Soubor:Icon-pdf.gif]] [http://www.picaxe.com/docs/axe120.pdf PICAXE MICRO-ROBOT] | |||
# [[Soubor:Icon-pdf.gif]] [http://letsmakerobots.com/files/lmr-Start.pdf How to make your first Robot] | |||
|} | |||
[[Soubor:PICAXE_18.jpg|thumb|PICAXE 18 z PIC16F88]] | |||
[[Soubor:PICAXE_01.jpg|thumb|Zapojení programovacího konektoru]] | |||
<gallery> | |||
Soubor:D10_HW_picaxe_01.jpg|PICAXE - vývojová deska | |||
Soubor:D10_HW_picaxe_02.jpg|PICAXE - popis vývojové desky | |||
Soubor:ProfiCAD_PICAXE.png|PICAXE - blokové schéma | |||
Soubor:D10_HW_picaxe_03.jpg|PICAXE - schéma vývojové desky | |||
</gallery> | |||
<gallery> | |||
Soubor:MAT-POZADAVKY-PRA-ROBOT-UMIK.jpg|Robot Umík | |||
Soubor:Umik-popis.png|Umík - popis | |||
Soubor:Umik-blok-schema.png|Umík - blokové schéma | |||
Soubor:Robot-umík-sch.jpg|Schéma zapojení robota Umíka | |||
Soubor:Robot-umík-dps.jpg|Deska plošných spojů | |||
</gallery> | |||
<Gallery> | |||
Soubor:PICAXE-vyv-diagram_01.jpg|Blik | |||
Soubor:PICAXE-vyv-diagram_02.jpg|DICE | |||
Soubor:PICAXE-vyv-diagram.jpg|2x IN, 2 x OUT | |||
</gallery> | |||
== Náměty:== | |||
<gallery> | |||
Image:D10 HW PICAXE-08M.jpg| [[PICAXE]]-08M MCU pro programování v Basicu. [http://shop.snailinstruments.com/index.php?main_page=advanced_search_result&search_in_description=1&zenid=f7ce17dec68c901d159d6c3ad334677f&keyword=picaxe] | |||
</gallery> | |||
{| | |||
|- | |||
| '''PICAXE8 LED''' | |||
[[Soubor:PICAXE-PICAXE80.jpg|200px]] | |||
[[Soubor:PICAXE-PICAXE80_1.jpg|200px]] | |||
| | |||
<source lang="qbasic"> | |||
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 | |||
</source> | |||
[http://www.joliebrisemodels.co.uk/picaxe/ PICAXE Microprocessor Tutorial] | |||
|- | |||
| '''PICAXE81''' | |||
[[Soubor:PICAXE-PICAXE81.jpg|200px]] | |||
| | |||
<source lang="qbasic"> | |||
</source> | |||
[ info] | |||
|- | |||
|} | |||
<gallery> | |||
Image:D10_HW_picaxe.jpg| Modul s [[PICAXE]]-18X. Programování v Basicu a [[SD20]]. [http://shop.snailinstruments.com/index.php?main_page=advanced_search_result&search_in_description=1&zenid=f7ce17dec68c901d159d6c3ad334677f&keyword=picaxe] | |||
</gallery> | |||
{| | |||
|- | |||
| '''LED blikání''' | |||
[[Soubor:PICAXE_LED.jpg|200px]] | |||
| | |||
<source lang="qbasic"> | |||
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 | |||
</source> | |||
|- | |||
| '''Běžící had''' | |||
[[Soubor:PICAXE_bezici_had.jpg|200px]] | |||
[[Soubor:Ukáza programu.jpg|Ukázka|200px]] | |||
| | |||
<source lang="qbasic"> | |||
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 | |||
</source> | |||
|- | |||
| '''Robot Umík''' | |||
[[Soubor:MAT-POZADAVKY-PRA-ROBOT-UMIK.jpg|200px]] | |||
| | |||
je postaven na podvozku UMU-01 Lze sestavit v konfiguraci stopař pro sledování čáry nebo minisumo | |||
* Čidlo okraje arény: 2x QRD1114 pro Minisumo | |||
* Čidlo čáry: 3x QRD1114 pro sledování čáry | |||
* Čidlo soupeře / překážky: SFH5110 + 2x IR-LED20 | |||
* Elektronika s PICAXE-18X | |||
* Programování v Basicu | |||
* Ovládání motorů můstkem L293D | |||
* [[Soubor:Icon-pdf.gif]] [[:Soubor:Robot-Umík-dokumentace.pdf|dokumentace]] | |||
|- | |||
| [[Soubor:technologystudent.gif|200px]] | |||
| [http://www.technologystudent.com/pics/picdex1.htm PICAXE MICROCONTROLLERS] | |||
|- | |||
| '''PICAXE02''' | |||
[[Soubor:PICAXE-Buuton-LED.jpg|200px]] | |||
[[Soubor:PICAXE-Button-LED_1.jpg|200px]] | |||
| | |||
<source lang="qbasic"> | |||
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 | |||
</source> | |||
[http://www.picaxe.com/BASIC-Commands/Digital-InputOutput/button/ info] | |||
|- | |||
| '''Push Switch''' | |||
[[Soubor:PICAXE-Buuton-LED.jpg|200px]] | |||
[[Soubor:PICAXE-Button-LED_2.jpg|200px]] | |||
| | |||
<source lang="qbasic"> | |||
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 | |||
</source> | |||
[http://www.picaxe.com/Circuit-Creator/Switches/Push-Switch/ info] | |||
|- | |||
| '''For..Next''' | |||
[[Soubor:PICAXE-Counter.jpg|200px]] | |||
| | |||
<source lang="qbasic"> | |||
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 | |||
</source> | |||
[[Soubor:Icon-pdf.gif]] [http://robotics.ee.uwa.edu.au/eyejr/pic-controller/PICAXE-tutorial.pdf info] | |||
|- | |||
| '''PICAXE03''' | |||
[[Soubor:PICAXE-PICAXE03.jpg|200px]] | |||
| | |||
<source lang="qbasic"> | |||
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 | |||
</source> | |||
[ info] | |||
|- | |||
| '''PICAXE04''' | |||
[[Soubor:PICAXE-PICAXE04.jpg|200px]] | |||
| | |||
<source lang="qbasic"> | |||
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 | |||
</source> | |||
[ info] | |||
|- | |||
| '''Counter''' | |||
[[Soubor:PICAXE-PICAXE04.jpg|200px]] | |||
| | |||
<source lang="qbasic"> | |||
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 | |||
</source> | |||
[ info] | |||
|- | |||
| '''Servo''' | |||
[[Soubor:PICAXE-PICAXE_servo.jpg|200px]] | |||
| | |||
<source lang="qbasic"> | |||
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 | |||
</source> | |||
[http://picaxe.hobbizine.com/servo.html info] | |||
|- | |||
|} |
Aktuální verze z 23. 2. 2021, 13:48
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
|