Cov txheej txheem:

Teeb Koj Lub Valentine Nrog Sparkling RGB Matrix: 3 Kauj Ruam
Teeb Koj Lub Valentine Nrog Sparkling RGB Matrix: 3 Kauj Ruam

Video: Teeb Koj Lub Valentine Nrog Sparkling RGB Matrix: 3 Kauj Ruam

Video: Teeb Koj Lub Valentine Nrog Sparkling RGB Matrix: 3 Kauj Ruam
Video: tuav wb lub neej kom ruaj khov - Mang Vang ft. Christina Xyooj [Official Audio] 2021-22 2024, Kaum ib hlis
Anonim

Los Ntawm Pom StudioSeeed Ua Raws Li Ntxiv los ntawm tus sau:

Sab Hauv Tes Tes tuav Co2 Ntes (rau Covid-19 Lub Hom Phiaj)
Sab Hauv Tes Tes tuav Co2 Ntes (rau Covid-19 Lub Hom Phiaj)
Sab Hauv Tes Tes tuav Co2 Ntes (rau Covid-19 Lub Hom Phiaj)
Sab Hauv Tes Tes tuav Co2 Ntes (rau Covid-19 Lub Hom Phiaj)
Ua Si Grove Analog Microphone Nrog Wio Terminal
Ua Si Grove Analog Microphone Nrog Wio Terminal
Ua Si Grove Analog Microphone Nrog Wio Terminal
Ua Si Grove Analog Microphone Nrog Wio Terminal
Grove - TF Mini LiDAR Nrog Wio Terminal
Grove - TF Mini LiDAR Nrog Wio Terminal
Grove - TF Mini LiDAR Nrog Wio Terminal
Grove - TF Mini LiDAR Nrog Wio Terminal

Txog: Nyob zoo, peb yog daim ntawv thov engineers hauv Seeed. Sib koom cov phiaj xwm nrog cov zej zog tsim khoom yog txaus. Vam tias koj nyiam nws XD Pom yog IoT kho vajtse tus neeg muab kev pabcuam uas txhawb IoT cov neeg tsim khoom kom nrawm dua … Ntau Txog Pom Pom Studio »

Hnub Valentine tab tom los, koj puas tau ntsib ib tus neeg uas hlub thaum pom thawj zaug?

Kauj Ruam 1: Yam Khoom Siv Hauv Txoj Haujlwm no

Cov khoom siv kho vajtse

  • Seeeduino V4.2
  • Lub hauv paus ntaub thaiv npog V2
  • Grove - RGB LED Matrix w/Tsav Tsheb
  • Grove - Dej Sensor

Software apps thiab cov kev pabcuam online

Arduino IDE Cov

Kauj Ruam 2: Kev Kho Vajtse Txuas

Kho vajtse txuas
Kho vajtse txuas

Hauv txoj haujlwm no, peb siv lub ntsuas dej los ntsuas dej, yog tias muaj dej, lub plawv dhia yuav tshwm tawm hauv RGB LED Matrix.

Txhawm rau ua tiav cov txiaj ntsig no, koj yuav tsum txuas Grove - Dej Sensor mus rau D2 chaw nres nkoj hauv Base Shield, thiab tseem txuas Grove - RGB LED Matrix rau I2C chaw nres nkoj hauv nws. Tom qab ntawd ntsaws Base Shield rau Seeeduino, ib yam li daim duab saum toj no.

Kauj ruam 3: Software Programming

Txhawm rau siv RGB LED matrix hauv koj qhov haujlwm, koj yuav tsum ntxiv nws lub tsev qiv ntawv rau koj Arduino IDE. Lub tsev qiv ntawv tuaj yeem rub tawm hauv

Pom_RGB_LED_Matrix

Tom qab ntxiv lub tsev qiv ntawv, suav nrog matrix's header file hauv koj cov cai:

#suav nrog "grove_two_rgb_led_matrix.h"

Kev txhais cov macros yog tus cwj pwm zoo, nws tuaj yeem ua rau koj cov cai yooj yim nyeem lossis hloov kho. Piv txwv li, koj tuaj yeem txhais macros los qhia qhov chaw nres nkoj twg uas lub ntsuas dej txuas nrog, lossis qhov nrawm yuav tsum ua rau lub plawv dhia.

#define SENSOR_PIN 2

#define INTERVAL 500

Thaum txhua yam ua tiav, tshaj tawm qhov piv txwv piv txwv rau kev siv tom qab.

GroveTwoRGBLedMatrixClass matrix;

Thiab nyem qhov no kom tau cov duab kho kom tsim koj tus kheej cov duab. Xaiv cov xim hauv kab xim, nyem dots hauv qhov chaw kos duab los kos, thiab thawb hloov tshiab lossis ntxig khawm hauv qab ntawm thaj chaw teeb duab, koj cov duab yuav raug hloov pauv mus rau tus lej thiab tso rau hauv lub npov ntawm sab xis.

Duab
Duab

Kuv cov duab zoo li hauv qab no. Koj tuaj yeem luam cov cai ntawd tso rau hauv koj qhov haujlwm, thiab tom qab ntawd qhia lawv hauv RGB LED matrix los ntawm kev ntsuas.

Duab
Duab

Cov txheej txheem teeb tsa () txheej txheem yuav ua haujlwm ib zaug thaum koj pib qhov haujlwm, yog li peb pib ua ntu zus thiab cov ntsuas dej tus pin hauv nws.

void teeb tsa () {

Hlau.begin (); pinMode (SENSR_PIN, INPUT); WAIT_MATRIX_READY (); }

Lub voj () txheej txheem yuav rov ua dua, yog li peb siv nws los kuaj xyuas yog tias muaj dej lossis tsis yog los ntawm cov cai hauv qab no:

yog (digitalRead (SENSOR_PIN) == LOW) {

}

Thaum cov dej ntsuas tawm LOW, nws txhais tau tias muaj dej, yog li ntaus lub plawv yuav tsum tau tshwm hauv RGB LED matrix

rau (uint8_t i = 0; i <EMOJI_COUNT (piv txwv); ++ i) {matrix.displayFrames (EMOJI (piv txwv, i), INTERVAL, cuav, 1); ncua (INTERVAL); }

Lub voj ua tiav () txheej txheem zoo li hauv qab no, thiab koj tuaj yeem rub tawm qhov ua tiav qhov kawg ntawm kab lus no.

void voj () {

yog (digitalRead (SENSOR_PIN) == LOW) {rau (uint8_t i = 0; kuv <EMOJI_COUNT (piv txwv); ++ i) {matrix.displayFrames (EMOJI (piv txwv, i), INTERVAL, cuav, 1); ncua (INTERVAL); }}}

Nyem Upload khawm hauv Arduino IDE txhawm rau rub koj cov haujlwm mus rau Seeeduino, thiab sim muab qee yam ntub rau dej ntsuas, saib dab tsi tshwm sim.

TSEEM CEEB:

Hauv cov ntawv firmware ntawm RGB LED matrix yog tias koj xav diy koj tus kheej duab nrog UNO cov lej koj yuav tsum hloov kho cov ntaub ntawv ntawm arduino. Yog tias koj siv mega lossis lotus, qhov kev hloov pauv yuav tsis xav tau.

Nrhiav cov ntawv teeb tsa arduino Arduino kho vajtse / arduino / avr / libraries / Wire / src, qhib Wire.h file

hloov

#define BUFFER_LENGTH 32

rau hauv

#define BUFFER_LENGTH 128

Tom qab ntawd nrhiav cov ntawv teeb tsa arduino Arduino kho vajtse arduino avr libraries / Wire / src / utility, qhib cov ntaub ntawv twi.h.

hloov

#define TWI_BUFFER_LENGTH 32

rau hauv

#define TWI_BUFFER_LENGTH 128

Pom zoo: