Cov txheej txheem:
Video: Qhib LED nrog Watson Kev Sib Tham: 6 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Koj yuav xav tau dab tsi:
Zagros Artificial Intelligence Raspberry Pi Kit
Kauj ruam 1:
Koj yuav tsum muaj qhov twb tau teeb tsa ntawm koj tus Pi. Koj tuaj yeem pom NPM's rpio-gpio qhov chaw muaj txiaj ntsig zoo rau syntax.
Kauj ruam 2:
Khiav cov lus txib npm nruab rpi-gpio hauv davhlau ya nyob twg.
Kauj ruam 3:
Peb pib nrog kev sib tham.js cov ntaub ntawv los ntawm Watson's TJBot piv txwv, thiab ntxiv cov kab hauv qab no ua ntej peb hloov peb tus bot sai.
var gpio = xav tau ('rpi-gpio');
var pin = 7;
gpio.setup (tus pin, gpio. DIR_OUT);
Thawj qhov ntsuas rau teeb tsa () yog cov channel. Nco ntsoov siv tus lej RPi tus lej thiab tsis yog GPIO. Qhov ntsuas thib ob yog kev taw qhia, DIR_OUT sau rau tus pin #7. Koj tseem tuaj yeem hloov lub npe ntawm koj tus bot rau qee yam sib txawv. Peb tau xaiv "Bob" vim nws tsis tshua muaj kev cuam tshuam nrog lwm cov lus.
// instantiate peb TJBot!
var tj = TJBot tshiab (kho vajtse, tjConfig, ntawv pov thawj);
tj.configuration.robot.name = "Bob";
Kauj ruam 4:
Tom qab cov lus hais ib feem ntawm txoj cai ntxiv cov cai hauv qab no rau kev lees paub hais lus.
var muaj On = msg.indexOf ("on")> = 0;
var containsOff = msg.indexOf ("tawm")> = 0;
var containsLight = msg.indexOf ("lub teeb")> = 0;
// tig lub teeb
yog (muaj Teeb && muaj Muaj) {
console.log ("Qhib Teeb")
gpio.write (tus pin, tseeb);
};
// tua lub teeb
yog tias (muaj Lub Teeb && muaj Off) {
console.log ("Tua Teeb")
gpio.write (tus pin, tsis tseeb);
};
Kauj ruam 5:
Teeb rau cov pins.
Kauj Ruam 6:
Ua tiav ntawm js js code.
Pom zoo:
Kev Sib Tham Sib Tham Punching Hnab: 3 Cov Kauj Ruam (nrog Duab)
Interactive Reflex Punching Bag: Cov lus qhia no yog rau txhua tus neeg uas xav txhim kho lawv cov kev txawj ntse thiab kev txawj ntaus nrig thaum tau txais kev paub ntau dua, siv Arduino, LED's thiab MK 2125 Accelerometer
SASSIE: Cov Txheej Txheem rau Kev Txaus Siab Tsis Txaus Siab thiab Kev Sib Tham Sib Tham: 5 Cov Kauj Ruam
SASSIE: Cov Txheej Txheem rau Kev Txom Nyem Tsis Txaus Siab thiab Kev Sib Tham Sib Tham: SASSIE yog lo lus teb rau lo lus nug peb txhua tus tau nug peb tus kheej thaum muaj kev ntsiag to txawv ntawm ib qho hauv peb lub neej, "Kuv puas yuav tham tom ntej?" Zoo tam sim no koj tsis tas yuav txhawj xeeb vim tias SASSIE tau tsim tshwj xeeb los lees paub qhov txawv txav uas ntsiag to
THIAB LUB NEEJ !! (Sib tham sib tham rooj sib tham): 4 Kauj Ruam
THIAB LUB NEEJ !! (sib tham sib tham txog Thruth Table): Nyob zoo cov phooj ywg, Kuv vam tias koj txhua tus nyob hauv koj lub tsev zoo thiab xav tsis thoob dab tsi ntawm cov ntaub ntawv uas muaj ?? Nkag siab cov rooj vag logic yog qhov tseem ceeb heev rau ob leeg
Dot² - Kev Sib Tham Sib Tham Rooj: 12 Cov Kauj Ruam (nrog Duab)
Dot² - Kev Sib Tham Sib Tham Rooj: Thaum kuv xyaum ua haujlwm, Kuv tau tsim cov lus sib tham uas koj tuaj yeem khiav cov duab, qee qhov txaus nyiam LED Teeb thiab yog, Ua si tsev kawm ntawv qub ua si !! Kuv tau txais kev tshoov siab los tsim lub rooj kas fes no los ntawm crt4041's Music Visualiser Table yog tswj
Cov Neeg Siv Yooj Yim Sib Tham Sib Tham rau Kev Qhia thiab Kev Ntsuam Xyuas: 11 Kauj Ruam
Cov Neeg Siv Yooj Yim Sib Tham Sib Tham rau Kev Qhia thiab Kev Ntsuam Xyuas: Txoj haujlwm no tau tsim los ua ib feem ntawm chav kawm hauv tsev kawm qib siab, lub hom phiaj yog ua kom muaj kev sib tham sib tham los qhia thiab ntsuas qee yam ncauj lus. Rau nws peb tau siv Kev Ua Haujlwm ntawm PC rau lub interface thiab Arduino NANO rau lub khawm arcade thiab LEDs, yog li