Cov txheej txheem:

Bluetooth Smartphone-tswj Ntse LED Teeb: 7 Kauj Ruam
Bluetooth Smartphone-tswj Ntse LED Teeb: 7 Kauj Ruam

Video: Bluetooth Smartphone-tswj Ntse LED Teeb: 7 Kauj Ruam

Video: Bluetooth Smartphone-tswj Ntse LED Teeb: 7 Kauj Ruam
Video: Часы G Shock до 100 долларов-15 лучших часов Casio G Shock до 100 дол... 2024, Hlis ntuj nqeg
Anonim
Image
Image
Bluetooth Smartphone-tswj Ntse LED Teeb
Bluetooth Smartphone-tswj Ntse LED Teeb

Kuv ib txwm npau suav txog kev tswj hwm kuv cov cuab yeej siv teeb pom kev zoo. Tom qab ntawd ib tus neeg ua lub teeb pom kev zoo nkauj LED zoo nkauj. Tsis ntev los no kuv tau hla lub Teeb LED los ntawm Joseph Casha ntawm Youtube. Tau txais kev tshoov siab los ntawm nws, Kuv txiav txim siab ntxiv ntau lub luag haujlwm thaum khaws cov qauv tsim niaj hnub no.

Lub phiaj xwm yog ua kom lub teeb ua kom zoo dua qub los ntawm kev ntxiv Bluetooth Module thiab hais tau WS2812B RGB LED sawb. Qhov no ua rau nws muaj peev xwm tswj cov xim ntawm lub teeb pom kev zoo tsuas yog siv lub smartphone app.

Kauj Ruam 1: Sau cov Khoom

Sau Cov Khoom
Sau Cov Khoom
Sau Cov Khoom
Sau Cov Khoom

Cov Cuab Yeej:

• Chaw Tua Hluav Taws

• Rhaub Dej Rhaub Phom

• Laum Tshuab

• Pom ncig

• Jigsaw

• Hlau Cutter Pliers

• Pliers-Noog Pliers

Cov ntaub ntawv:

• Lub Rooj Tswjhwm Saib Cov Acrylic translucent

• Japanese Cypress Ntoo (lossis koj tuaj yeem siv cov ntoo ntev li nws ruaj khov thiab muaj zog txaus)

• Screws

• Tus Ncej Hlau lossis Ntoo

• Cov xov hlau (Kuv siv xaim liab thiab dub)

• Soldering Tin

Cov Khoom Siv Hluav Taws Xob:

• Arduino Nano

• Bluetooth Module HC-05 (Kuv txiav txim siab siv qhov no vim nws yooj yim dua rau tus lej dua li Wifi Module ESP8266)

• WS2812B Addressable RGB LED Sawb

• LM2596 Step-down Module

• DC Barrel Power Jack

Kauj Ruam 2: Txhim Kho Cov Qauv Ntawm Lub Teeb

Txhim Kho Lub Teeb Ntawm Lub Teeb
Txhim Kho Lub Teeb Ntawm Lub Teeb
Txhim Kho Lub Teeb Ntawm Lub Teeb
Txhim Kho Lub Teeb Ntawm Lub Teeb

Hauv cov theem no, Kuv muaj ob txoj hauv kev los tsim cov qauv ntawm lub teeb- txheej txheem ntoo thiab txheej txheem luam ntawv 3D. Kuv siv thawj txoj kev. Yog tias koj xav ua nws los ntawm kev siv lub tshuab luam ntawv 3D, xav tias dawb hla mus rau qib 2 rau tus qauv uas kuv tsim.

Txog rau sab saud ntawm lub teeb, kuv ua kom sov thiab khoov cov acrylic board rau lub kaum sab xis 90 ° raws li tau hais los saum no. Kuv siv sijhawm ntev heev los kho nws kom zoo li lub kaum ntse ntse thiab kev coj ua.

Tom ntej no, rau sab qis ntawm lub teeb. Hmoov tsis zoo … hnub uas kuv tab tom ua haujlwm qis dua ntawm lub teeb, Kuv tsis nco qab coj daim duab ntawm kev tsim kho! Kuv pom tau hais tias thaum kuv ua tiav txoj haujlwm no. Tab sis kuv yuav sim kuv qhov zoo tshaj plaws los ntsuas koj qhov ntsuas qis ntawm lub teeb.

Qhov tseeb, koj tsuas yog xav txiav plaub ntu ntoo uas ntsuas 13x6x2cm (LxHxW). Tom ntej no, koj yuav tsum txiav tus ntaiv zoo li txiav ntawm ntug ntoo. Daim duab yuav pom saum toj no.

Kauj Ruam 3: Cov Duab 3D

Cov duab 3D
Cov duab 3D
Cov duab 3D
Cov duab 3D

Rau txhua tus neeg uas muaj lawv tus kheej lub tshuab luam ntawv 3D, koj nyob hauv qhov raug. Qhov no ua rau lub teeb no siv tus phooj ywg.

Yuav kom ncaj ncees, qhov no yog qhov nyuaj tshaj plaws uas kuv tau ua. Nov yog thawj qhov kuv tau ua tom qab teeb tsa software!

Kuv siv Sketchup Pro los tsim cov qauv ntawm lub teeb. Hmoov tsis zoo, Kuv tsis txawj txaus los tsim nws cov khoom sab hauv. Qhov txuas rau kuv tus qauv 3D yog hauv cov ntawv hauv qab no.

Kauj Ruam 4: Cov Txheej Txheem 'Schematic

Cheebtsam 'Schematic
Cheebtsam 'Schematic

Kuv siv Fritzing los tsim cov lej ntawm cov khoom. Schematic yog qhov yooj yim zoo nkauj.

Kauj ruam 5: Txoj Cai

Txoj Cai
Txoj Cai

Txog qhov cim ntawm lub teeb pom kev zoo no, Kuv tau siv qee lub tsev qiv ntawv los ntawm Arduino IDE. Cov tsev qiv ntawv yuav teev nyob rau qib 7.

Txog cov cai, koj yuav tsum muaj Arduino software nws tus kheej. Kuv yuav muab qhov txuas mus rub tawm ntawm no.

Tsis tas li, daim duab kos lossis cov cai yuav qhia hauv qab no?

Kuv kuj tau muab cov ntaub ntawv rau tus lej hauv Github.com yog tias cov cai hauv qab no ntev dhau los theej ntawm no;)

#include #include #include #ifdef _AVR_ #include #endif

SoftwareSerial BT (10, 11);

#define LED_PIN 7 #define NUM_LEDS 60 #define BRIGHTNESS 200 #define SPEED 10 #define IMMEDIATELY 0 #define RAINBOW_SPEED 50 CRGB leds [NUM_LEDS];

Adafruit_NeoPixel strip = Adafruit_NeoPixel (NUM_LEDS, LED_PIN, NEO_GRB + NEO_KHZ800);

bool offOld = LOW;

bool WhiteOld = LOW; bool RedOld = LOW; bool GreenOld = LOW; bool BlueOld = LOW; bool TopazOld = LOW; bool LilacOld = LOW; bool RainbowOld = LOW; bool rgbOld = LOW; int showType = 0;

void teeb tsa () {

FastLED.addLeds (leds, NUM_LEDS); ////////////

BT.begin (9600);

BT.println ("Txuas rau Arduino");

strip.setBrightness (BRIGHTNESS);

strip.begin ();

strip.show ();

}

char ib;

void voj () {

rau (int i = 0; i <= 59; i ++) {leds = CRGB (255, 255, 255); FastLED.show (); } bool tawm = LOW; bool Dawb = LOW; bool Blue = LOW; bool Liab = LOW; bool Ntsuab = LOW; bool Topaz = LOW; bool Lilac = LOW; bool Zaj sawv = LOW; bool rgb = LOW; bool kawg; yog (BT.available ()) {a = (char) BT.read ();

yog (a == 'o')

{tawm = HIGH; BT.println ("TURNING OFF LEDs..");

lwm yam {

tawm = LOW; } // ================================================ ========================================================

yog (a == 'w')

{Dawb = HIGH; BT.println ("TURNING LEDs WHITE");

lwm yam {

Dawb = LOW; } // ================================================ ========================================================

yog (a == 'b')

{Xiav = HIGH; BT.println ("Hloov mus rau Xiav"); } lwm {Blue = LOW; }

// ===========================================================================================

yog (a == 'r')

{Liab = HIGH; BT.println ("Hloov mus RED"); } lwm {Liab = LOW; }

// ===========================================================================================

yog tias (a == 'g')

{Ntsuab = HIGH; BT.println ("Hloov mus rau ntsuab"); } lwm {Ntsuab = LOW; }

// ===========================================================================================

yog (a == 't')

{Topaz = HIGH; BT.println ("Hloov mus rau TOPAZ"); } lwm {Topaz = LOW; }

// ===========================================================================================

yog (a == 'l')

{Lilac = HIGH; BT.println ("Hloov mus LILAC"); } lwm {Lilac = LOW; }

// ===========================================================================================

yog tias (a == 'a')

{Zaj sawv = HIGH; BT.println ("RAINBOW ANIMATION"); } lwm {Zaj sawv = LOW; } // ================================================ ========================================================

yog (a == 'm')

{rgb = HIGH; BT.println ("MIX COLORS"); } lwm tus {rgb = LOW; }} yog (tawm == LOW && offOld == HIGH) {ncua (20); yog (tawm == LOW) {showType = 0; // Tawm cov tsiaj ntawv hom 0 startShow (showType); }}

// ===========================================================================================

yog (Dawb == LOW && WhiteOld == HIGH) {

ncua (20); yog (Dawb == LOW) {showType = 1; // Cov yeeb yaj kiab dawb Hom 1 startShow (showType); }}

// ======================================================== =========================================== yog (Liab == LOW && RedOld == HIGH) {ncua (20); yog (Liab == LOW) {showType = 2; // Liab animation Hom 2 startShow (showType); }}

// ===========================================================================================

yog (Ntsuab == LOW && GreenOld == HIGH) {

ncua (20); yog (Ntsuab == LOW) {showType = 3; // Green animation Hom 3 startShow (showType); }} // ================================================ ========================================================

yog tias (Blue == LOW && BlueOld == HIGH) {

ncua (20); yog (Xiav == LOW) {showType = 4; // Blue animation Type 4 startShow (showType); }}

// ===========================================================================================

yog (Topaz == LOW && TopazOld == HIGH) {

ncua (20); yog (Topaz == LOW) {showType = 5; // Topaz animation Hom 5 startShow (showType); }}

// ===========================================================================================

yog (Lilac == LOW && LilacOld == HIGH) {

ncua (20); yog (Lilac == LOW) {showType = 6; // Topaz animation Hom 6 startShow (showType); }} // ================================================ ========================================================

yog (Zaj sawv == LOW && RainbowOld == HIGH) {

ncua (20);

yog tias (Zaj sawv == LOW) {

showType = 8; // Zaj duab xis zaj duab xis Yam 8 startShow (showType); }}

// ===========================================================================================

yog tias (rgb == LOW && rgbOld == HIGH) {

ncua (20);

yog tias (rgb == LOW) {

showType = 7; // Sib xyaw hom 7 rgb = HIGH;

startShow (showType);

} }

WhiteOld = Dawb;

RedOld = Liab; BlueOld = Xiav; GreenOld = Ntsuab; TopazOld = Topaz; LilacOld = Lilac; offOld = tawm; RainbowOld = Zaj sawv; rgbOld = rgb;

}

void startShow (int kuv) {

hloov (i) {

rooj plaub 0: colorWipe (strip. Color (0, 0, 0), SPEED); Dub/tawm

tawg;

rooj plaub 1: strip.setBrightness (255); // Hloov qhov Brightness rau MAX

colorWipe (strip. Color (255, 255, 255), TSEV KAWM NTAWV); // Dawb strip.setBrightness (BRIGHTNESS); // Rov pib dua qhov Brightness rau qhov ua txhaum tus nqi;

rooj plaub 2: colorWipe (strip. Color (255, 0, 0), SPEED); // Liab

tawg;

rooj plaub 3: colorWipe (strip. Color (0, 255, 0), SPEED); Ntsuab

tawg;

rooj plaub 4: colorWipe (strip. Color (0, 0, 255), SPEED); Xiav

tawg;

rooj plaub 5: colorWipe (strip. Color (0, 250, 255), SPEED); // Cov Topaz

tawg;

rooj plaub 6: colorWipe (strip. Color (221, 130, 255), SPEED); // Liab

tawg; rooj plaub 7: colorWipe (strip. Color (255, 0, 0), SPEED); // Liab ximWipe (strip. Color (0, 255, 0), SPEED); // Ntsuab ximWipe (strip. Color (0, 0, 255), SPEED); // Blue theatreChase (strip. Color (0, 0, 127), SPEED); // Blue theatreChase (strip. Color (127, 0, 0), SPEED); // Red theaterChase (strip. Color (0, 127, 0), SPEED); Ntsuab so;

rooj plaub 8: rainbowCycle (25);

tawg; }} void colorWipe (uint32_t c, uint8_t tos) {rau (uint16_t kuv = 0; i

tsis muaj dab tsi rainbowCycle (uint8_t tos) {

uint16_t kuv, j;

rau (j = 0; j <256*10; j ++) {// 5 mus ntawm txhua xim ntawm lub log rau (i = 0; kuv <strip.numPixels (); i ++) {strip.setPixelColor (i, Log (((kuv * 256 / strip.numPixels ()) + j) & 255)); } strip.show (); ncua (tos); }}

void theatreChase (uint32_t c, uint8_t tos) {

rau (int j = 0; j <10; j ++) {// ua 10 cycles ntawm kev caum rau (int q = 0; q <3; q ++) {rau (int i = 0; i <strip.numPixels (); i = kuv+3) {strip.setPixelColor (i+q, c); // tig txhua pixel thib peb ntawm} strip.show ();

ncua (tos);

rau (int i = 0; i <strip.numPixels (); i = i+3) {strip.setPixelColor (i+q, 0); // tig txhua pixel thib peb tawm}}}}

uint32_t Log (byte WheelPos) {

WheelPos = 255 - WheelPos; yog (WheelPos <85) {rov qab strip. Color (255 - WheelPos * 3, 0, WheelPos * 3); } yog (WheelPos <170) {WheelPos -= 85; rov qab strip. Color (0, WheelPos * 3, 255 - WheelPos * 3); } WheelPos -= 170; rov qab strip. Color (WheelPos * 3, 255 - WheelPos * 3, 0); }

Kauj Ruam 6: Tswj Lub Teeb

Tswj Lub Teeb
Tswj Lub Teeb
Tswj Lub Teeb
Tswj Lub Teeb
Tswj Lub Teeb
Tswj Lub Teeb

Xim ntawm lub teeb tuaj yeem tswj tau los ntawm kev siv koj lub xov tooj.

Ua ntej, koj yuav tsum teeb tsa lub app hu ua 'Bluetooth Terminal HC-05' los ntawm Google Play Store lossis Apple App Store.

Nov yog cov kauj ruam los tswj lub teeb ntawm koj tus kheej lub xov tooj:

1. Qhib bluetooth hauv koj lub smartphone.

2. Qhib lub app uas yog 'Bluetooth Terminal HC-05'.

3. Tam sim no koj yuav tsum pom cov khoom ua ke ntawm lub vijtsam. Xaiv 'HC-05'.

4. Tam sim no koj tuaj yeem pom lub vijtsam dub tshwm hauv koj lub smartphone uas yuav qhia tias 'txuas nrog Arduino'.

5. Nov yog qhov lom zem, yog tias koj ntaus 'b' hauv kab ntawv, lub teeb yuav tig mus rau xim xiav. Nov yog cov npe ntawm cov lus txib uas koj tuaj yeem ntaus rau lub teeb:

-w rau dawb

-b rau xiav

- g rau ntsuab

- r rau liab

-t rau topaz

- l rau lilac

- rau zaj duab xis zaj duab xis

-o rau off

Kev lom zem txoj cai?

6. Kawg tab sis tsis tsawg, koj kuj tuaj yeem kho lub pob hauv qab ntawm qhov screen rau koj cov ntawv xav tau raws li qhia hauv daim duab saum toj no.

Kauj Ruam 7: Txaus Siab Rau Koj Lub Teeb Mood

Txaus Siab Rau Koj Lub Teeb Mood !!
Txaus Siab Rau Koj Lub Teeb Mood !!
Txaus Siab Rau Koj Lub Teeb Mood !!
Txaus Siab Rau Koj Lub Teeb Mood !!
Txaus Siab Rau Koj Lub Teeb Mood !!
Txaus Siab Rau Koj Lub Teeb Mood !!

Kuv vam tias koj nyiam qhov Instructables. Nws yog txoj haujlwm nyuaj rau kuv tab sis kuv tswj kom ua tiav nws li 14 xyoos tus tub. Ua rau kuv qee cov lus tawm tswv yim rau kev txhim kho yav tom ntej.

Ua tsaug rau kev nyeem ntawv thiab Zoo siab heev Christmas!

Pom zoo: