Cov txheej txheem:

Android G1 Serial rau Arduino Robot: 8 Kauj Ruam
Android G1 Serial rau Arduino Robot: 8 Kauj Ruam

Video: Android G1 Serial rau Arduino Robot: 8 Kauj Ruam

Video: Android G1 Serial rau Arduino Robot: 8 Kauj Ruam
Video: ፎቶሾፕን በቀላሉ ኢንስቶል እና ክራክ ያድርጉ አማርኛ ቱቶርያል How to install and crack photoshop Amharic tutorial 2024, Kaum ib hlis
Anonim
Hauv G1 Serial rau Arduino Neeg Hlau
Hauv G1 Serial rau Arduino Neeg Hlau
Hauv G1 Serial rau Arduino Neeg Hlau
Hauv G1 Serial rau Arduino Neeg Hlau
Hauv G1 Serial rau Arduino Neeg Hlau
Hauv G1 Serial rau Arduino Neeg Hlau

Kawm paub yuav ua li cas koj lub xov tooj ntawm tes tuaj yeem tswj tus neeg hlau siv Arduino board. Lub xov tooj siv cov lus txib ntawm telnet los ntawm lwm lub xov tooj lossis PC, yog li koj tuaj yeem tswj tus neeg hlau nyob deb. Txoj haujlwm no yuav tsis hloov pauv hloov G1 yog li koj tuaj yeem siv nws li koj lub xov tooj ib txwm tom qab qhib nws vim li cas? Los ntawm kev siv cov khoom siv hluav taws xob pheej yig xws li Arduino boards, koj tuaj yeem ua ke nrog koj li $ 400 lub xov tooj los ua tus neeg hlau txaus. Nws yuav raug nqi ntau pua daus las ntxiv GPS, LCD's, lub zog ntsuas hluav taws xob, wi-fi, txuas xov tooj ntawm tes, hais lus, thiab ntau ntxiv rau kev nyiam ua haujlwm bot, tab sis koj lub xov tooj twb muaj cov no lawm! Ua ke, Android G1 thiab Arduino pawg thawj coj tso cai rau koj siv cov khoom siv hluav taws xob pheej yig xws li cov kev pabcuam yooj yim thiab cov ntsuas, txhawm rau tsim cov cuab yeej muaj zog xws li neeg hlau, lub xov tooj cua nyob deb, lossis cov khoom ua si lom zem rau menyuam. Cov ntaub ntawv ntau ntxiv ntawm Cellbots.com. Ntawm Ceeb Toom: Txoj haujlwm no tam sim no xav tau Android G1 nrog hauv paus nkag mus siv cov ntawv tso tawm ntawm lub xov tooj mus rau Arduino neeg hlau. Koj tuaj yeem ntxiv $ 20 BlueTooth module rau koj pawg Arduino kom muaj lub xov tooj tham nrog nws dhau ntawm BlueTooth yog tias koj xav siv kev lag luam hauv software. Ua tsaug tshwj xeeb: Peb muaj Hacker Dojo hauv Mountain View, CA ua tsaug rau muab peb kov, pab nrog qee qhov teeb meem nyuaj ntawm lawv daim ntawv teev npe ntawm cov tswv cuab txaus, thiab kom muaj 74LS04 chips hauv Tshuag. Feem ntau ntawm kev sib dhos tau ua tiav ntawm Tech Shop hauv Menlo Park.

Kauj Ruam 1: Cov Khoom Xav Tau

Yam Khoom Xav Tau
Yam Khoom Xav Tau
Yam Khoom Xav Tau
Yam Khoom Xav Tau
Yam Khoom Xav Tau
Yam Khoom Xav Tau

Txhawm rau ua kom tiav cov lus qhia no koj yuav xav tau cov hauv qab no: Kho vajtse: - Android G1 Dev Xov Tooj (lossis lwm yam khoom siv hauv Android nrog rau hauv paus nkag thiab cov ntawv tso tawm) - Arduino (Kuv siv Freeduino SB tab sis ib qho yuav tsum ua) - 3.3v txog 5v hloov dua siab tshiab yog tias koj tsis siv 3.3v Arduino (Kuv tab tom siv 74LS04 nti rau qis dua $ 1 tab sis muaj lwm txoj hauv kev xaiv) - HTC USB so -board board rau G1 - Cov cuab yeej siv rau ob qhov txuas nrawm - Lub cev neeg hlau nrog micro servos (duab los qhia, acrylic, treads, log, txhua yam yuav ua) Software: - Android Scripting Environment (ASE) - Telnet tus thov rau koj lub PC (Kuv siv PuTTY ntawm Windows) - Arduino kev txhim kho ib puag ncig - (xaiv tau) Cov neeg siv khoom siv rau koj lub PC (Kuv tseem siv PuTTY ntawm Windows rau qhov no) - (xaiv tau) Android SDK Yog tias koj tuaj yeem ua raws cov lus qhia koj tuaj yeem ua tiav qhov kev qhia no nrog kev paub me ntsis txog Python, Arduino, Android, lossis khoom siv hluav taws xob. Koj yuav xav paub cov khoom ntawd yog tias koj xav mus dhau qhov ntsais ntsais LED tab sis qhov no yuav ua rau koj pib.

Kauj ruam 2: Android G1 Nrog Serial Output Enabled

Android G1 Nrog Serial Output Enabled
Android G1 Nrog Serial Output Enabled
Android G1 Nrog Serial Output Enabled
Android G1 Nrog Serial Output Enabled
Android G1 Nrog Serial Output Enabled
Android G1 Nrog Serial Output Enabled

G1's tsis xa nrog lub peev xwm xa cov lus txib tawm ntawm USB chaw nres nkoj thiab tsis muaj kev xaiv ib txwm los pab nws. Yog tias koj yog tus siv Android SDK siab dua koj tuaj yeem tsim koj tus kheej tab sis kuv xaiv siv Cyanogenmod 4.2.13. Yog tias koj paub txog lwm yam khoom siv hauv Android nrog cov ntawv tawm ua haujlwm, ntxiv lawv rau cov lus pom.

Kev xaiv, koj tuaj yeem ua raws cov kab ntawv txuas rau qhov no qhia txog kev tham nrog koj G1 hla USB los ntawm koj lub PC. Cov ntawv txuas rau USB txuas tsis tas yuav tsum tau ua rau qhov kev qhia no tab sis kuv tau siv nws los ua qhov kev saib xyuas zoo kom paub tseeb tias lub xov tooj tau xa tawm tawm. Yog tias koj tsis siv lwm qhov kev nkag siab los txheeb xyuas cov ntawv tso tawm ua haujlwm, koj tuaj yeem sim qhov kev txheeb xyuas yooj yim no: 1. Qhib Terminal app ntawm G1 (los nrog Cyanogen tab sis rub tawm ib qho los ntawm Kev Lag Luam yog tias koj muaj cov duab sib txawv) 2 Nkag mus rau/dev/phau ntawv teev npe los ntawm kev ntaus hauv cd/dev/3. Hom ls (uas yog L) thiab nrhiav ttyMSM2 hauv cov npe xa rov qab Python tsab ntawv peb yuav siv tom qab xa cov lus txib rau '/dev/ttyMSM2' hauv xaj kom lawv tawm mus rau qhov txuas txuas. Txij li qhov ntawd xav tau kev nkag mus hauv paus, koj yuav tsum hloov pauv kev tso cai ntawm qhov ntawd txhua zaus koj rov qhib lub xov tooj. Txhawm rau ua qhov no: 1. Qhib lub davhlau ya nyob twg app hauv xov tooj 2. Nkag mus rau 'chmod 777 /dev /ttyMSM2' Tom qab ntawd koj tuaj yeem khiav Python tsab ntawv los ntawm Android Scripting hloov kho hauv cov kauj ruam tom ntej thiab nws yuav muaj kev nkag mus xa cov ntawv tso tawm.

Kauj Ruam 3: Txhim Kho Android Ib Cheeb Tsam Scripting (ASE) Nrog Python

Nruab ib qho Android Scripting Environment (ASE) Nrog Python
Nruab ib qho Android Scripting Environment (ASE) Nrog Python
Nruab ib qho Android Scripting Environment (ASE) Nrog Python
Nruab ib qho Android Scripting Environment (ASE) Nrog Python

Cov ntawv sau uas peb yuav siv los tsim qhov qhib qhov sib txuas ntawm lub xov tooj thiab xa cov lus txib tawm yog sau hauv Python. Txhawm rau ua qhov no ntawm G1 peb yuav xav tau Android Hauv Ib Cheeb Tsam. Yog tias koj tsis pom nws hauv Kev Ua Lag Luam koj tuaj yeem rub nws los ntawm kev tshuaj xyuas lub barcode ntawm nplooj ntawv uas txuas rau apk cov ntaub ntawv ntawm nplooj ntawv no.

Thaum koj nruab thiab khiav ASE koj yuav xav ntxiv ntawm Python module los ntawm cov ntawv qhia zaub mov: 1. Qhib ASE thiab xyuas kom tseeb tias koj muaj kev sib txuas hauv is taws nem ua haujlwm (wi-fi lossis 3G) 2. Nias lub tshuab raj khawm hauv xov tooj thiab xaiv Cov neeg txhais lus 3. Nias cov ntawv qhia zaub mov dua thiab xaiv Ntxiv 4. Xaiv Python (tam sim no v2.6.2 raws li sau qhov no) thiab nws yuav rub tawm qee cov zip file Koj yuav xav tshawb nrhiav, qhib, kho, thiab khiav cov ntawv kom paub nrog Python ntawm ASE tab sis nws tsis xav tau.

Kauj Ruam 4: Luam thiab Khiav Cellbot.py Tsab Ntawv los Pib Txoj Haujlwm Python

Luam thiab Khiav Cellbot.py Tsab ntawv los qhib qhov program Python
Luam thiab Khiav Cellbot.py Tsab ntawv los qhib qhov program Python

Cov ntawv qhia no siv cov ntawv Python los ua "lub hlwb" ntawm tus neeg hlau. Tau txais cov cai tshiab los ntawm peb qhov qhib Google Code project. Koj tsuas xav tau cov ntawv cellbot.py tab sis lwm tus tuaj yeem pab nrog ntau yam uas koj xav tshawb. Kuv yooj yim ntsaws lub xov tooj rau hauv kuv lub PC USB txuas thiab teeb tsa tsav ua ntej luam cov ntawv rau/sdcard/ase/scripts.

Qhov kev zov me nyuam tsim qhov qhib qhov txuas txuas kom lees txais kev sib tham telnet. Nws kuj tseem luam cov lus txib tau txais rau lub vijtsam thaum xa lawv tawm ntawm qhov chaw nres nkoj. Muab cov ntawv no tso rau hauv xov tooj daim npav SD hauv/ase/scripts/directory. Detailed steps to load and run the scripts: 1. Copy the cellbot.py script to the SD card's/ase/scripts/directory 2. Nco ntsoov tshem tawm SD daim npav los ntawm koj lub PC yog tias koj theej lawv li ntawd vim tias lub xov tooj tsis tuaj yeem nkag tau cov ntaub ntawv tib lub sijhawm koj lub PC. 3. Qhib Android Scripting Environment app 4. Nyem rau ntawm cellbot.py kom tso nws Koj yuav tsum pom qhov kev lees paub tias lub cuab yeej tau npaj tiav ntawm lub sijhawm no kom lees txais cov xov tooj sib tham tuaj ntawm chaw nres nkoj 9002. Tswv yim: Nco ntsoov khiav "chmod 777 /dev/ttyMSM2 "hais kom ua los ntawm kauj ruam #3 ua ntej. Saib qib #5 txhawm rau nrhiav tus IP chaw nyob ntawm tus xov tooj.

Kauj Ruam 5: Telnet Rau Hauv G1 thiab Xeem Xa Nws Cov Lus txib

Telnet Rau Hauv G1 thiab Xeem Xa Nws Cov Lus txib
Telnet Rau Hauv G1 thiab Xeem Xa Nws Cov Lus txib
Telnet Rau Hauv G1 thiab Xeem Xa Nws Cov Lus txib
Telnet Rau Hauv G1 thiab Xeem Xa Nws Cov Lus txib
Telnet Rau Hauv G1 thiab Xeem Xa Nws Cov Lus txib
Telnet Rau Hauv G1 thiab Xeem Xa Nws Cov Lus txib

Lub xov tooj yuav tsum tau npaj rau koj telnet rau hauv nws thiab xa nws cov lus txib los ntawm koj lub PC. Nws yuav luam lawv mus rau lub xov tooj lub vijtsam kom paub tseeb tias nws tau txais dab tsi. Kuv tau siv PuTTY ntawm Windows tab sis peb tau lees tias minicom ua haujlwm zoo ntawm Macs raws li tau piav qhia hauv cov lus qhia no.

Koj yuav tsum xub nrhiav koj tus lej IP chaw nyob. Qhov no muaj los ntawm kev mus rau Ntawv qhia zaub mov> Chaw> Wireless tswj> Wi-nkaus nqis thiab tom qab ntawd nias qhov kev sib txuas tam sim no. Cov lus qhia pop-up toast yuav los nrog tus IP chaw nyob tam sim no ntawm lub network. Sau qhov no raws li koj yuav siv qhov no txhua lub sijhawm koj xav qhib kev sib tham telnet los ntawm koj lub PC. Cov haujlwm IP feem ntau tas sijhawm tom qab qee hnub, yog li koj yuav tsum tau rov tshuaj xyuas qhov no dua. Kev xa xov mus rau sab nraud ntawm lub network hauv zej zog yuav tsum ua tau tab sis tsis muaj nyob ntawm no. Qhib koj tus neeg siv xov tooj ntawm tes xaiv thiab txuas rau IP ntawm lub xov tooj ntawm chaw nres nkoj 9002. Los ntawm kab hais kom ua koj ua qhov no "telnet 192.168.1.1 9002" siv tus IP tiag tiag ntawm lub xov tooj. Ntaus qee cov cim thiab ntaus nkag mus kom pom lawv tshwm ntawm lub xov tooj lub vijtsam. Koj tuaj yeem ntaus a q kom ua rau Python tsab ntawv txiav tawm, uas yuav tsum kaw koj lub davhlau ya nyob twg. Yog tias yog vim li cas koj tsis tuaj yeem txuas ntawm telnet thiab xav tau tua qhov program, kev rov ua haujlwm yooj yim ntawm lub xov tooj yuav tsum ua qhov dag. Cov neeg siv qib siab yuav xav nrhiav tus txheej txheem ID ntawm ps thiab tom qab ntawd siv tua kom nres nws. Advanced: Yav tom ntej ntawm qhov no tuaj yeem khiav lub vev xaib hauv zos los ntawm lub xov tooj ntau dua li lees txais cov lus txib ntawm telnet. Peb tseem tab tom tshawb XMPP los tham nrog koj tus neeg hlau.

Kauj Ruam 6: Txuas 3.3v txog 5v Qib Shifter mus rau Arduino

Txuas 3.3v txog 5v Qib Shifter mus rau Arduino
Txuas 3.3v txog 5v Qib Shifter mus rau Arduino
Txuas 3.3v txog 5v Qib Shifter mus rau Arduino
Txuas 3.3v txog 5v Qib Shifter mus rau Arduino
Txuas 3.3v txog 5v Qib Shifter mus rau Arduino
Txuas 3.3v txog 5v Qib Shifter mus rau Arduino

Arduino siv hauv qhov kev qhia no yog 5v qauv yog li peb yuav tsum hloov pauv 3.3v teeb liab los ntawm G1 siv qib hloov pauv. Nws yuav tsum muaj peev xwm txuas ncaj qha mus rau 3.3v Arduino tab sis qhov ntawd tsis yog qee yam kuv tau sim.

Muaj ntau txoj hauv kev los mus rau qhov no tab sis peb yuav siv 74LS04 nti hauv qhov piv txwv no. Koj tuaj yeem tshawb nrhiav ib qho ntawm no thiab lawv zoo li qis dua $ 1. Tim thiab kuv tau khaws peb li los ntawm Hacker Dojo hauv Mountain View, CA tab sis cov no yog qhov ntau heev thiab yuav tsum muaj nplua nuj nyob qhov twg los xij uas muag lossis pub dawb. Ntawm qib siab peb tsuas yog xa TX lub teeb liab los ntawm HTS USB pawg thawj coj tawg rau hauv tus pin 1 ntawm 74LS04 nti. Ua kom nws ua haujlwm peb mus dhau lub nti ob zaug thiab tawm tus pin 4 mus rau RX tus pin ntawm Freeduino SB (koj tus lej txuas yuav txawv yog tias koj muaj lwm pawg Arduino tab sis txhua tus yuav tsum txhawb qhov no). Ua raws cov theem no txhawm rau txhawm rau hloov pauv qib thiab txuas HTC USB lub rooj tsavxwm (tsis txhob ntsaws nws rau hauv xov tooj tseem tsis tau txuas thiab txuas lub hwj chim rau Arduino): 1. Ntxig lub 74LS04 nti rau hauv koj lub khob cij. Nco ntsoov tias lub nti hla lub hauv paus tawg kom cov pins tsis luv (qhov ruam uas kuv tau ua thaum xub thawj) 2. Cov tub rog ob lub xov hlau mus rau HTC USB pawg thawj coj raws li tau piav qhia hauv cov lus qhia no, tab sis peb tsuas yog siv tus pin 7 (Hauv av) thiab 8 (TX0) txij li peb tsuas yog ua ib txoj kev xa mus rau qhov kev qhia no. 3. Txuas lwm qhov kawg ntawm av (tus pin 7) xaim mus rau hauv av ntawm koj lub khob cij (uas yuav tsum txuas nrog hauv av ntawm koj Arduino) 4. Txuas lwm qhov kawg ntawm TX0 (tus pin 8) xaim mus rau lub khob cij qhov twg nws sau rau tus pin 1 ntawm 74LS04 nti. (ua qhov kev tshawb nrhiav duab kom pom daim duab tag nrho ntawm lub nti) 5. Siv xaim txuas tus pin 2 thiab 3 ntawm tus ntiv tes 6. Txuas tus pin 4 ntawm tus ntiv tes mus rau Arduino RX point (tus pin 0 ntawm Freeduino SB thiab Arduino Duemilanove) 7. Txuas tus pin 7 (GND) ntawm tus ntiv tes rau hauv av rau koj lub khob cij (uas tseem txuas rau Arduino av) 8. Txuas tus pin 14 (VCC) mus rau lub zog 5v ntawm koj lub khob cij (uas tau txais lub zog los ntawm Arduino 5v tso tawm) Tam sim no koj yuav tsum npaj kom ntsaws hauv HTC USB lub rooj sib tsoo tawm hauv qab ntawm lub xov tooj thiab lub zog ntawm Arduino. Txheeb xyuas cov txim taws thiab tsw ntxhiab thiab kov tej yam kom paub tseeb tias lawv txias heev. Yog tias koj tseem tsis muaj neeg hlau koj tseem tuaj yeem tshawb xyuas kom pom tias LED qhib thiab tawm kom paub tseeb tias nws ua haujlwm.

Kauj Ruam 7: Thauj cov Cellbots Program ntawm Arduino

Thauj cov Cellbots Program ntawm Arduino
Thauj cov Cellbots Program ntawm Arduino
Thauj cov Cellbots Program ntawm Arduino
Thauj cov Cellbots Program ntawm Arduino

Tau txais Arduino qhov chaws los ntawm peb qhov Google Code qhov chaw. Qhib Cellbots.pde Arduino program hauv Arduino editor. Tom qab ntawd thawb nws mus rau koj lub Rooj Tswjhwm Saib Arduino.

Koj tuaj yeem sim tham nrog Arduino tus lej los ntawm kev qhib lub ntsuas saib hauv Arduino tus khoos phis tawj. Nov yog txoj hauv kev zoo los ntsuas koj lub neeg hlau lossis lub cuab yeej los ntawm kev tham ncaj qha mus rau Arduino ua ntej txuas txhua yam rau hauv xov tooj. Nco tseg: Koj tsis tuaj yeem thauj cov program mus rau Arduino thaum lub xov tooj txuas nrog rau RX cov lej nkag tus lej. Yog li koj yuav xav tso qhov no hloov pauv tab sis kuv tsuas yog ntsaws nws thaum kuv xav tau thauj lub program tshiab.

Kauj Ruam 8: Khiav Cov Txheej Txheem Tag Nrho

Khiav Cov Txheej Txheem Tag Nrho
Khiav Cov Txheej Txheem Tag Nrho
Khiav Cov Txheej Txheem Tag Nrho
Khiav Cov Txheej Txheem Tag Nrho
Khiav Cov Txheej Txheem Tag Nrho
Khiav Cov Txheej Txheem Tag Nrho

Koj yuav tsum muaj peev xwm txuas HTC USB lub rooj tsavxwm rau lub xov tooj, tua hluav taws cellbot.py cov ntaub ntawv hauv ASE, thiab qhib lub davhlau ya nyob twg rau hauv xov tooj. Ntaus "H" kom muaj lub xov tooj hais nyob zoo lossis lwm yam lus txib los ntawm README.txt cov ntaub ntawv.

A "q" yuav tso Python tsab ntawv ntawm lub xov tooj thiab kaw lub qhov (socket) lub dav hlau. Qhov no yog qhov rov ua dua ntawm nws txhua yam ua haujlwm li cas: 1. Tsab ntawv nab hab sej qhib lub qhov (socket) kom txais kev txuas xov tooj sib txuas thiab ncha cov lus txib tawm ntawm qhov chaw nres nkoj 2 Peb txuas los ntawm peb lub PC mus rau lub xov tooj ntawm telnet ntawm chaw nres nkoj 9002 thiab xa nws cov lus txib uas peb pom ntawm lub vijtsam 3. Lub HTS USB board cuam tshuam nrog G1's USB chaw nres nkoj thiab xa 3.3v teeb liab mus rau 74LS04 tus pin 1. 4. lub teeb liab tawm los ntawm tus ntiv tes ntawm tus pin 2, rov qab mus rau tus pin 3, thiab rov qab los dua ntawm tus pin 4 ntawm 5v 5. Peb Arduino lees txais lub teeb liab ntawm RX tus pin 0 thiab txheej txheem nws ntawm Cellbot.pde program 6. Peb tuaj yeem ntaus 'q' tua Python tsab ntawv thiab kaw qhov txuas telnet Tam sim no koj tau ua tiav cov txheej txheem nyuaj no kom xa cov lus txib yooj yim mus rau Arduino neeg hlau, nws yog lub sijhawm rau koj hack nws kom txaus txaus! Peb tseem tsis tau muaj 2 txoj hauv kev ua haujlwm kom Arduino tsis tuaj yeem xa cov lus txib rov qab rau hauv xov tooj tab sis peb tab tom ua haujlwm ntawd. Nyob twj ywm tam sim no los ntawm kev sau npe rau peb blog ntawm Cellbots.com. Txog Tus Sau: Tim Heath Lead tus kws tshawb fawb uas xub muab cov txheej txheem no ua ke ntawm Tech Shop hauv Menlo Park, qhov uas nws yog tus tswv cuab. Ryan Hickman Programmer uas ua haujlwm ntawm Python thiab Arduino code thiab tau txais kev tso cai qhia no.

Pom zoo: