Cov txheej txheem:
- Kauj Ruam 1: Yam Koj Xav Tau
- Kauj Ruam 2: Tsim Koj Li Circuit Court
- Kauj Ruam 3: Sau Koj Li Code
- Kauj ruam 4: Tsim Koj Lub App
- Kauj Ruam 5: Sim Nws
Video: Tswj Arduino Nrog Android thiab USB: 5 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:28
Cov lus qhia no tsuas yog ua kom pom sai ntawm "Arduino USB Serial Extension" uas tau tsim los ntawm Thunkable tus tsim tawm, Pavitra. Nws tseem tab tom txhim kho yog li xav txog qhov no yog hom beta version.
Hauv qhov yooj yim, tam sim no koj tuaj yeem tsim kev cai Android app thiab siv nws los sib txuas lus ntawm USB nrog ntau pawg Arduino sib txawv.
Kuv tau npaj qhov ua piv txwv yooj yim qhov twg lub app tuaj yeem hloov RGB LED ntawm 5 lub xeev sib txawv (Liab, Ntsuab, Xiav, Dawb thiab Tawm) tab sis kuv txaus siab tiag tiag pom cov tswv yim twg hauv zej zog Cov Lus Qhia los nrog.
Kauj Ruam 1: Yam Koj Xav Tau
Yam yuavtsum tau kawm uantej
- Qee qhov kev paub pib ntawm block-based programming, xws li Kos lossis App Inventor
- Kev nkag siab yooj yim ntawm Arduino - piv txwv li koj tau ua tiav qhov "Blink" kos duab
Kho vajtse
- Ib Arduino + USB Cable. Kuv tau sim qhov no nrog Uno, Leonardo thiab Micro.
- Ib Android Xov Tooj
- USB OTG txuas
- Qee qhov khoom siv hluav taws xob rau kev sim
Software
- Arduino IDE
- Ib qho "App Inventor 2" software sib xws, Kuv tau xaiv rau Thunkable
- Ib daim qauv ntawm Pavitra's Arduino USB Serial Extension
Kauj Ruam 2: Tsim Koj Li Circuit Court
Koj tuaj yeem yooj yim tawm nrog tsuas yog Arduino nws tus kheej ntawm no thiab siv on-board LED, tab sis kom ua rau nws ntxim siab me ntsis Kuv tau siv RGB LED.
Lub Circuit Court yog qhov yooj yim heev:
Cov pin hauv av ntawm LED txuas nrog ib qho ntawm Arduino cov av hauv av [Cov Hlau Dub], Cov liab, ntsuab thiab xiav txuas nrog PWM pins ntawm Ω resistors. Koj tuaj yeem lees paub PWM pins los ntawm ~ cim ib sab ntawm tus lej tus lej.
Cov xov hlau liab, ntsuab thiab xiav nyob hauv daim duab muaj qhov yooj yim los qhia qhov twg ntawm ceg ntawm LED sib raug rau cov xim twg. Hauv qee qhov LEDs tus pin xiav thiab ntsuab yuav thim rov qab.
Kauj Ruam 3: Sau Koj Li Code
Txhua tus lej hauv qab no tuaj yeem pom ntawm Github
Pib los ntawm teeb tsa qee cov npe sib txawv rau koj Arduino Pins
// kuj txawv txav rau Serial input
int tswv yim = 0; // Pins rau LEDs const int LED = 13; const int redPin = 11; const int greenPin = 9; const int bluePin = 10;
Tom ntej no, ntxiv qhov no rau teeb tsa () muaj nuj nqi:
void teeb tsa () {
// Pib qhov saib xyuas ntawm 9600 baud Serial.begin (9600); // Tshaj tawm cov LEDs los ua tus pinMode (LED, OUTPUT); pinMode (redPin, OUTPUT); tus pinMode (greenPin, OUTPUT); tus pinMode (bluePin, OUTPUT); }
Tom qab ntawd kos rau Serial input:
void voj () {
// txheeb xyuas yog tias muaj cov ntaub ntawv nkag, yog (Serial.available ()> 0) {// yog li, ces nyeem cov ntaub ntawv nkag. cov tswv yim = Serial.read (); // ua xim sib txawv nyob ntawm tus nqi nkag yog (input == '1') {make_colour (255, 0, 0); } lwm yog (input == '2') {make_colour (0, 255, 0); } lwm yog (input == '3') {make_colour (0, 0, 255); } lwm yog (input == '4') {make_colour (0, 0, 0); } lwm yog (input == '5') {make_colour (255, 255, 255); }}}
Thaum kawg, ua kom cov xim tsim nyog:
void make_colour (int r, int g, int b) {
// tsuas yog rau kev sim Serial.println ("Ua Xim"); // teeb tsa lub luag haujlwm rau txhua tus pin analogWrite (redPin, r); analogWrite (greenPin, g); analogWrite (bluePin, b); }
Kauj ruam 4: Tsim Koj Lub App
Txhawm rau pib nrog app sai li sai tau koj tuaj yeem clone nws ncaj qha rau Thunkable los ntawm txhaj rau ntawm no.
Tsim
Tus tsim ntawm no app yog txhob txwm yooj yim. Nws tsuas yog ob peb lub khawm thiab, tau kawg, Arduino cov ntawv txuas ntxiv.
Yog tias koj tsis paub nrog txhim kho.aix cov ntaub ntawv koj tuaj yeem nyeem Conor phau ntawv qhia pib sai ntawm no.
Code
Hauv cov thaiv, kuv tau tsim cov txheej txheem hu ua lighsOn uas yog hu ua txhua lub sijhawm nias lub pob.
Cov nyees khawm liab, ntsuab thiab xiav xa cov cim '1', '2' thiab '3' mus rau Arduino, feem.
Cov cim '4' thiab '5' tau siv los tig lub LED dawb thiab tawm.
Nws kuj yog lub tswv yim zoo kom suav nrog khawm rov pib dua uas kaw thiab rov qhib kev sib txuas rau Arduino
Kauj Ruam 5: Sim Nws
Tam sim no koj tau npaj los sim nws.
1. Rub cov duab kos rau koj Arduino
2. Nruab.apk ntawm koj Lub Xov Tooj
3. Txuas koj lub xov tooj rau koj Arduino nrog OTG Cable thiab koj zoo mus.
Teeb meem
Thaum koj xub pib lub app nrog Arduino txuas nrog, koj yuav tsum tau tso cai rau nws nkag mus rau lub cuab yeej USB (Arduino)
Yog tias koj pom lub sijhawm ua yuam kev, sim kaw qhov kev sib txuas thiab tom qab ntawd qhib nws dua. Qhov no yuav tsum txhim kho koj cov teeb meem, tab sis nco ntsoov tias qhov no tseem tab tom sim yog li thov tawm lus yog tias nws tsis ua haujlwm rau koj.
Pom zoo:
Bluetooth Tswj RC Tsheb Nrog Tshaj Tawm Kev Tswj thiab Kev Ntsuas Kev Ntsuas: 8 Kauj Ruam
Bluetooth Tswj RC Tsheb Nrog Tshaj Tawm Kev Tswj thiab Kev Ntsuas Kev Ntsuas: Raws li menyuam yaus, Kuv ib txwm nyiam los ntawm RC tsheb. Niaj hnub no koj tuaj yeem pom ntau yam qhia kom ua Bluetooth pheej yig tswj RC tsheb koj tus kheej nrog kev pab los ntawm Arduino. Cia peb ua nws ib qib ntxiv thiab siv peb cov kev paub siv tswv yim ntawm kinematics los laij
Qhov muag tsis pom kev Nrog ESP8266, Google Tsev thiab Openhab Kev Sib Koom thiab Kev Tswj Xyuas Web: 5 Cov Kauj Ruam (nrog Duab)
Qhov muag tsis pom kev Nrog ESP8266, Google Tsev thiab Openhab Kev Sib Koom thiab Kev Tswj Xyuas Web: Hauv Cov Lus Qhia no kuv qhia koj li cas kuv ntxiv kev siv tshuab rau kuv qhov muag tsis pom. Kuv xav kom muaj peev xwm ntxiv thiab tshem tawm qhov kev siv tshuab nws, yog li txhua qhov kev teeb tsa yog clip ntawm.Qhov tseem ceeb yog: Stepper motor Stepper tsav tswj bij ESP-01 Iav thiab teeb tsa
8 Relay Tswj Nrog NodeMCU thiab IR Txais Txais Siv WiFi thiab IR Chaw Taws Teeb thiab Android App: 5 Kauj Ruam (nrog Duab)
8 Relay Tswj Nrog NodeMCU thiab IR Txais Txais Siv WiFi thiab IR Chaw Taws Teeb thiab Android App: Tswj 8 qhov hloov pauv hloov siv nodemcu thiab ir tus txais tshaj wifi thiab ir chaw taws teeb thiab hauv app.the ir tej thaj chaw deb ua haujlwm ywj pheej ntawm wifi txuas. NTUJ
Begging Neeg Hlau Nrog Saib Xyuas Lub Ntsej Muag thiab Tswj los ntawm Xbox Tus Tswj - Arduino: 9 Cov Kauj Ruam (nrog Duab)
Begging Robot Nrog Lub ntsej muag taug qab thiab Tswj los ntawm Xbox Controller - Arduino: Peb tab tom yuav ua tus thov neeg hlau. Tus neeg hlau no yuav sim ua rau khaus lossis ua rau pom kev dhau ntawm tib neeg. Nws yuav ntes lawv lub ntsej muag thiab sim tua lasers ntawm lawv. Yog tias koj muab tus neeg hlau ib npib, nws yuav hu nkauj thiab seev cev. Tus neeg hlau yuav xav tau
Kub thiab Vaum Zaub thiab Sau Cov Ntaub Ntawv Nrog Arduino thiab Ua: 13 Kauj Ruam (nrog Duab)
Kub thiab Vaum Zaub thiab Sau Cov Ntaub Ntawv Nrog Arduino thiab Ua: Intro: Qhov no yog Txoj Haujlwm uas siv Arduino board, Sensor (DHT11), lub khoos phis tawj Windows thiab Kev Ua Haujlwm (rub tawm dawb) program los tso saib Kub, Cov ntaub ntawv vaum hauv digital thiab bar kab ntawv, tso tawm lub sijhawm thiab hnub tim thiab suav lub sijhawm suav