VEXcode IQ

Ustvarjanje, prenos in zaganjanje projekta Python v VEXcode IQ

Ustvarjanje in prenos projektov Python v VEXcode IQ je enostavno.


Kako ustvariti projekt Python

New Blocks project opened in VEXcode IQ.

Zaženite VEXcode IQ. Platforma se privzeto odpre v vmesniku Blocks.

VEXcode IQ Toolbar with the File menu open and the New Text Project option highlighted. New Text Project is the second option in the menu, below New Blocks Project.

Izberite »File« in nato »New Text Project«, da odprete besedilni vmesnik.

VEXcode IQ Select a Project Language prompt that has options for Python or C++. Python can only be run on 2nd gen IQ, but C++ projects work on both 1st gen and 2nd gen IQ. Either language can be selected to open a new project, or below there is a Cancel button that will close the menu. The Python project option is highlighted.

Nato izberite programski jezik Python. Na voljo imate možnost ustvariti nov projekt v C++ ali Python. Opomba: Trenutno so projekti Python združljivi samo z elektroniko IQ (2. generacija).

New Python project opened in VEXcode IQ.

Odprl se bo vmesnik Python.


Kako sestaviti projekt Python

V tem razdelku je prikazano, kako ustvariti osnoven projekt Python z ukazi iz orodne vrstice (Tool Box). Opisani projekt bo robot IQ (2. generacija) BaseBot premaknil naprej za 200 milimetrov (mm).

VEXcode IQ Toolbar with the File menu open and the Open Examples option highlighted. Open Examples is the fifth option in the menu, below New Blocks Project, New Text Project, Open, and Open Recent.

Izberite »File« in nato »Open Examples«, da odprete predlogo projekta.

BaseBot Drivetrain 2 motor example project thumbnail.

Izberite predlogo Basebot (Drivetrain 2-motor). Predloge so prazni projekti z vnaprej nastavljenimi konfiguracijami naprav.

VEXcode IQ Unsaved Project prompt that reads Your project was never saved. Save now? There are two buttons below, one reads Discard and the other reads Save.

Če vaš projekt ni bil shranjen, se bo pred odprtjem vzorčnega projekta v delovnem prostoru prikazalo okno »Save now«.

Izberite »Save«, če želite shraniti prejšnji projekt, sicer izberite »Discard«.

VEXcode IQ with a template Example Project opened, including configured devices and code comments with a description of the project.

Upoštevajte, da se v delovnem prostoru odpre niz komentarjev projekta. Ukaze boste dodajali za komentarji.

VEXcode IQ with the Clawbot Drivetrain 2 motor template Example Project opened. A specific blank line of code at line 47 is highlighted directly below the comment that reads Begin project code.

Na koncu zadnje vrstice kode (vrstica 46) pritisnite tipko Enter. S tem ustvarite naslednjo oštevilčeno vrstico (vrstica 47). Tu boste začeli dodajati kodo projektu.

VEXcode IQ with the Drive for command highlighted in the Python Toolbox.

Zdaj lahko dodajate ukaze iz orodne vrstice (Toolbox). Izberite ukaz Drive for.

VEXcode IQ with the BaseBot Drivetrain 2 motor template Example Project opened. The previously blank line of code now has a Drive for command in it that reads drivetrain.drive_for(FORWARD, 200, MM).

Povlecite ukaz Drive for v delovni prostor in ga postavite v zadnjo vrstico projekta (vrstica 47).


Kako prenesti in zagnati projekt Python

VEXcode IQ Toolbar with the project name field highlighted and renamed to Drive Forward. To the right of the project name a label reads Saved.

Najprej poimenujte in shranite projekt Python. Za podrobnejše informacije o shranjevanju projekta Python v VEXcode IQ si oglejte enega od naslednjih člankov:

VEXcode IQ with the Slots dropdown menu opened. There are 8 available slots for downloading projects to the Brain, and the first slot is highlighted.

Nato izberite, v kateri reži Brain boste prenesli projekt. To storite tako, da na orodni vrstici izberete gumb »Slot«.

VEXcode IQ Toolbar with the green Brain icon highlighted, indicating that the Brain is connected.

Nato povežite Brain z vašo napravo (neposredno prek Micro-USB, USB-C ali prek Controller. Oglejte si ta razdelek zbirke znanja, kjer izveste več o povezovanju Brain IQ z VEXcode IQ) in preverite, ali je ikona Brain zelena.

VEXcode IQ Toolbar with the Download icon highlighted in between the Brain and Run icons.

Izberite gumb »Download«, da prenesete projekt v Brain. Projekt bo prenesen v izbrano režo.

VEXcode IQ Toolbar with the Run icon highlighted in between the Download and Stop icons.

Na koncu izberite »Run«, da zaženete projekt, medtem ko je robot še vedno priključen na vaš računalnik.

VEXcode IQ 2nd gen Brain screen is shown with the Drive Forward project's options opened and the Run button selected.

Lahko pa Brain odklopite od naprave in projekt zaženete neposredno na Brain IQ.

Spletna trgovina

Potrebujete dodatne dele?

Originalni VEX deli, razširitveni seti in kompleti — vse za vaš naslednji robotski projekt na trgovina.robotech.si.

Pripravil RoboTech STEM Center
Stopite v stik

Imate
vprašanje?

Pišite nam — odgovorimo v najkrajšem možnem času.

Vaši podatki so varni in zaupni.