Cov txheej txheem:

Tsim kom Gesture Controlled Robot: 4 Kauj Ruam (nrog Duab)
Tsim kom Gesture Controlled Robot: 4 Kauj Ruam (nrog Duab)

Video: Tsim kom Gesture Controlled Robot: 4 Kauj Ruam (nrog Duab)

Video: Tsim kom Gesture Controlled Robot: 4 Kauj Ruam (nrog Duab)
Video: 20 MOMENTS YOU WOULDN'T BELIEVE IF NOT FILMED 2024, Kaum ib hlis
Anonim
Image
Image

Hauv Cov Lus Qhia no peb tsim Arcbotics Sparki neeg hlau uas tuaj yeem tswj tau nrog 3D piav tes piav taw. Cov yam ntxwv zoo ntawm txoj haujlwm no yog tias tsis muaj lub cuab yeej ntxiv xws li lub xov tooj smartphone lossis hnab looj tes xav tau los tswj tus neeg hlau. Tsuas yog txav koj txhais tes hla cov electrode (95 x 60mm thaj chaw rhiab). MGC3130 Hillstar Kev Txhim Kho Khoom Siv los ntawm Microchip tau siv rau 3D piav tes piav taw kev nkag siab lub cev.

Kauj Ruam 1: Cov Cheeb Tsam Yuav Tsum Tau

Cov Cheeb Tsam Yuav Tsum Tau
Cov Cheeb Tsam Yuav Tsum Tau
Cov Cheeb Tsam Yuav Tsum Tau
Cov Cheeb Tsam Yuav Tsum Tau
Cov Cheeb Tsam Yuav Tsum Tau
Cov Cheeb Tsam Yuav Tsum Tau
  1. Arcbotics Sparki, Arduino raws tus neeg hlau. Lwm yam Arduino raws cov neeg hlau yuav ua haujlwm ib yam nkaus.
  2. MGC3130 Hillstar Development Kit los ntawm Microchip, lwm yam 3D piav tes piav taw, xws li Hover thawj lossis Hover 2.0 Los ntawm Hover Labs, lossis Flick! kuj yuav tsum ua haujlwm.
  3. Ob peb qhov Knex (tsis ntau npaum li hauv daim duab)
  4. Kab xev kab xev
  5. Jumper xov hlau

Kauj ruam 2: Sib dhos

Los ua ke
Los ua ke
Los ua ke
Los ua ke
Los ua ke
Los ua ke

Cov khoom siv piav tes piav taw Hillstar 3D suav nrog peb lub rooj tsavxwm:

  1. MGC3130 Tus Qauv. qhov no yog qhov tseem ceeb Hillstar kev tswj tuav tes, nws cuam tshuam ntawm ib sab mus rau cov hluav taws xob, thiab ntawm lwm sab kom muaj zog thiab I2C interface.
  2. Plaub txheej txheej siv hluav taws xob nrog thaj tsam 85x60mm rhiab, hauv qab ntawm cov phaj no yog cov txuas txuas rau MGC3130 pawg thawj coj saib.
  3. I2C rau USB tus choj choj. Nrog lub rooj tsavxwm no MGC3130 tus qauv tuaj yeem txuas nrog lub PC nrog USB yooj yim.

I2C rau USB tus choj tsis xav tau, raws li peb txuas I2C ntawm MGC3130 Module ncaj qha mus rau Robot IO cov chaw nres nkoj, raws li qhia hauv daim duab qhia saum toj no.

Ib lub me me Knex trolly tau tsim los txhawb cov pawg siv hluav taws xob siv. Lub rooj tsav xwm tau txuas nrog lub laub thauj khoom nrog qee cov kab xev, thiab lub trolley ua tiav tau txuas nrog tus neeg hlau nrog Ty-qhwv. Thaum kawg MGC3130 Module tau txuas nrog tus neeg hlau IO cov chaw nres nkoj nrog cov xov hlau txuas.

Kauj ruam 3: Code

Code
Code

Lub software yog ua raws Hover library los ntawm Hover Labs thiab tuaj yeem pom ntawm Github (https://github.com/jspark311/hover_arduino).

Hauv qab no yog daim duab Arduino uas tuaj yeem rub tawm rau Sparki.

Muaj qhov tshwj xeeb Sparki IDE muaj, hu ua SparkiDuino, tab sis kuv nyiam siv tsuas yog tus qauv Arduino IDE thiab Nruab Sparki Arduino lub tsev qiv ntawv, uas tuaj yeem rub tawm los ntawm nplooj ntawv rub tawm: https://arcbotics.com/downloads Nws tsis yooj yim li. raws li SparkiDuino, thiab nws tsis tuaj nrog nws tus kheej txhim kho tus tsav tsheb (Sparki tus neeg tsav tsheb teeb tsa kuj tseem nyob ntawm nplooj ntawv rub tawm), tab sis nws siv txhua qhov piv txwv qub thiab cov lej qiv ntawv thiab nws yooj yim dua ua ke nrog lwm lub tsev qiv ntawv, zoo li Hover hauv qhov no rooj plaub.

#suav nrog // suav nrog lub tsev qiv ntawv sparki

#include #include // Pin tshaj tawm rau Hover int ts = 0; int pib dua = 1; Hover yuj = Hover (); byte kev tshwm sim; Txoj hlua output_string = ""; bool driving_forward = tsis tseeb; void teeb () {ncua (4000); sparki.clearLCD (); sparki.println ("Initializing Hover … thov tos."); sparki.updateLCD (); hover.begin (ts, pib dua); sparki.clearLCD (); sparki.println ("Npaj rau Gestures!"); sparki.updateLCD (); } khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob ថ្លៃ (tsis muaj dab tsi) {// Txheeb xyuas yog Hover tau npaj txhij xa tes taw lossis kov cov xwm txheej yog (hover.getStatus (ts) == 0) {// Tau txais qhov xwm txheej dhau i2c thiab luam tawm nws qhov xwm txheej = hover.getEvent (); // Tshooj lus no tuaj yeem tawm tswv yim yog tias koj tsis xav pom qhov xwm txheej hauv cov ntawv nyeem output_string = hover.getEventString (kev tshwm sim); yog (output_string! = "") {sparki.print (kev tshwm sim); sparki.println ("=" + output_string); sparki.updateLCD (); } hloov (xwm txheej) {rooj plaub 40: tsav_forward = muaj tseeb; tawg; rooj plaub 80: sparki.moveBackward (); tawg; rooj plaub 36: sparki.moveLeft (); ncua (500); sparki.moveStop (); tawg; rooj plaub 34: sparki.moveRight (); ncua (500); sparki.moveStop (); tawg; rooj plaub 72: sparki.gripperOpen (); tawg; rooj plaub 66: sparki.gripperClose (); tawg; rooj plaub 68: sparki.servo (80); tawg; rooj plaub 65: sparki.servo (-80); tawg; rooj plaub 48: tsav_forward = tsis tseeb; sparki.gripperStop (); sparki.servo (0); tawg; } yog (driving_forward) {sparki.moveForward (); } lwm {sparki.moveStop (); } // Pib dua Hover rau cov xwm txheej tom ntej hover.setRelease (ts); }}

Kauj ruam 4: Txaus siab rau

Image
Image

Cov npe ntawm cov lus txib:

  • Swipe up - tsav rau pem hauv ntej
  • Los so rov qab - nres txhua qhov kev txav mus los
  • Los sab laug - lem sab laug
  • Los sab xis - tig sab xis
  • Coj mus rhaub sab saum toj - tig lub sensor 90 degrees cw
  • Coj mus rhaub hauv qab - tig lub sensor 90 degrees ccw
  • Coj mus rhaub sab laug - kaw tus tuav
  • Coj mus rhaub sab xis - qhib gripper

Pom zoo: