Vadnice za programiranje

Programiranje z Brain enoto VEX GO

Brain enota VEX GO se uporablja za zaznavanje pospeška in rotacije.

Battery with its connection cable plugged into the Battery Port on a Brain.

Opomba: v tem članku vzorčni projekti uporabljajo gradnjo Code Base GO.


Uporaba Brain enote

Close up view of the Brain to highlight its design and built in Gyro and Accelerometer.

Brain ima vgrajen žiroskop in pospeškomer. Uporablja se ju za zaznavanje pospeška in rotacije.

Brain lahko zazna:

VEXcode GO Acceleration of block that reads acceleration of x axis. The block's dropdown menu is open to demonstrate that the measured axis can be changed to x, y, or z.

Pospešek. Brain lahko poroča o pospeških vzdolž vseh treh osi s pomočjo bloka (Acceleration of).

Diagram of the Brain with the x, y, and z-axis indicated by colored arrows. When viewing the Brain from above and to the side with the Eye and Battery Ports facing towards you, the positive Z axis is down, the positive Y axis is to the left, and the positive X axis is pointing towards you.

Brain poroča o pospeških vzdolž treh osi: x, y in z. Vsaka os ima pozitivno in negativno smer.

VEXcode GO Drive heading block that reads Drive heading in degrees.

Smer in rotacija. Brain lahko poroča o vrednosti smeri v stopinjah s pomočjo bloka (Drive heading).

Top down diagram of the Brain with a circle and degree units marked around it, indicating that the heading of the Brain can range from 0 to 359.99 degrees.

Vrednost smeri se poroča v razponu od 0 do 359,99 stopinj. Vrednost se meri pri zasuku v smeri urinega kazalca.

VEXcode GO Drive rotation block that reads Drive rotation in degrees.

Brain lahko poroča o vrednosti rotacije v stopinjah s pomočjo bloka (Drive rotation).

Top down diagram of the Brain with two arrows marked on either side of it indicating rotation. The arrow pointing clockwise is labeled as 'Rotation Increasing', and the arrow pointing counter clockwise is labeled as 'Rotation Decreasing'.

Vrednost rotacije poroča pozitivne vrednosti pri zasuku v desno in negativne vrednosti pri zasuku v levo. Vrednosti rotacije so kumulativne in niso omejene na 0 ali 360 stopinj. Vrednost se bo neprekinjeno povečevala ali zmanjševala z vsakim nadaljnjim zasukom.


Vzorčni projekt: prikaz pospeška

VEXcode GO blocks project that uses a Forever block with Looks blocks to print the x, y, and z acceleration of the Brain every 0.25 seconds.

Spodnja koda bo poročala o vrednosti pospeška vsake osi med vrtenjem enote Code Base.

VEXcode GO with the Print Console menu opened and highlighted. The previous project has been run and the x, y, and z acceleration values have been printed to the Console.

Konzolo za izpis (Print Console) lahko uporabite za ogled sprememb vrednosti pospeška v realnem času.


Vzorčni projekt: prikaz smeri in rotacije

VEXcode GO blocks project that reports the Drive heading and Drive rotation values as the robot turns right using a Repeat block. First, the project uses a Set drive heading block and a Set drive rotation block and sets them both to 0 as a default. Next is a Repeat block set to repeat 8 times, with a Turn right for 90 degrees block and then Print blocks to print the current heading and rotation values. At the end of the Repeat block there is a Wait 1 second block to ensure that the robot has enough time to turn.

Spodnja koda bo poročala o smeri pogona enote Code Base in vrednosti rotacije med njenim obračanjem.

VEXcode GO with the Print Console menu opened and highlighted. The previous project has been run, and the Heading and Rotation values have been printed to the Console as the robot turned to the right.

Konzolo za izpis (Print Console) lahko uporabite za ogled sprememb vrednosti smeri in rotacije v realnem času.

Opazite, da so vrednosti smeri prikazane v smeri urinega kazalca med 0 in 359,99 stopinjami, ker se enota Code Base obrača v desno. Vrednosti rotacije so kumulativne — neprekinjeno se povečujejo (zasuk v desno) ali zmanjšujejo (zasuk v levo).

The previous VEXcode GO block project that has been changed to turn left instead of right. First, the project uses a Set drive heading block and a Set drive rotation block and sets them both to 0 as a default. Next is a Repeat block set to repeat 8 times, with a Turn left for 90 degrees block and then Print blocks to print the current heading and rotation values. At the end of the Repeat block there is a Wait 1 second block to ensure that the robot has enough time to turn.

Prilagodite blok [Turn for] v projektu, da spremenite smer iz »desno« v »levo«, in znova zaženite projekt.

VEXcode GO with the Print Console menu opened and highlighted. The previous project has been run, and the Heading and Rotation values have been printed to the Console as the robot turned to the left.

V konzoli za izpis (Print Console) opazite, da so vrednosti smeri prikazane v smeri urinega kazalca med 0 in 359,99 stopinjami, ker se enota Code Base obrača v levo. Első zasuk v levo za 90 stopinj je prikazan kot smer 270 stopinj. Vrednosti rotacije se z vsakim zasukom povečujejo, vendar so — ker se enota Code Base obrača v levo — prikazane kot negativne.

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.