Cov txheej txheem:

Fancy Bed Night Lights: 6 Kauj Ruam (nrog Duab)
Fancy Bed Night Lights: 6 Kauj Ruam (nrog Duab)

Video: Fancy Bed Night Lights: 6 Kauj Ruam (nrog Duab)

Video: Fancy Bed Night Lights: 6 Kauj Ruam (nrog Duab)
Video: 20 MOMENTS YOU WOULDN'T BELIEVE IF NOT FILMED 2024, Kaum ib hlis
Anonim
Image
Image

Los ntawm Danni FR Ua raws kuv ntawm twitter Ua raws ntau los ntawm tus sau:

Kab Follower Neeg Hlau rau Kev Qhia Tswj Kev Ua Haujlwm
Kab Follower Neeg Hlau rau Kev Qhia Tswj Kev Ua Haujlwm
SAMI - Tsav Tsheb Tsav Tsheb rau Neeg Hlau
SAMI - Tsav Tsheb Tsav Tsheb rau Neeg Hlau
SAMI - Tsav Tsheb Tsav Tsheb rau Neeg Hlau
SAMI - Tsav Tsheb Tsav Tsheb rau Neeg Hlau
Microcontrollers 101 - Pab Pib Pib Pib thiab Txuag Kho Vajtse ntawm Koj Cov Haujlwm
Microcontrollers 101 - Pab Pib Pib Pib thiab Txuag Kho Vajtse ntawm Koj Cov Haujlwm
Microcontrollers 101 - Pab Tau Pib Pib Pib thiab Txuag Kho Vajtse ntawm Koj Cov Haujlwm
Microcontrollers 101 - Pab Tau Pib Pib Pib thiab Txuag Kho Vajtse ntawm Koj Cov Haujlwm

Txog: Kuv txaus siab rau cov thev naus laus zis tshiab thiab yam uas peb tuaj yeem ua hauv tsev nrog ob peb yam khoom thiab kev xav me ntsis. Xav paub ntau ntxiv txog Danni FR »

Nov yog lub teeb pom kev zoo ntawm yav tom ntej! Lawv qhib thaum koj tawm ntawm koj lub txaj thaum ib tag hmo thiab tua thaum koj taug kev mus rau hauv koj lub tshuab npau suav zoo. Yog li tsis muaj xwm txheej hmo ntuj ntxiv thiab tsoo ntiv taw !!

Qhov no yog super yooj yim los ua thiab koj lub txaj yuav saib tawm ntawm lub ntiaj teb no. Yog li cia peb pib, puas yog?

Kauj Ruam 1: Sau Txhua Qhov

Sau Txhua Qhov
Sau Txhua Qhov
Sau Txhua Qhov
Sau Txhua Qhov

Okey, txhawm rau pib peb yuav tsum muaj txhua feem uas xav tau rau txoj haujlwm no. Thov nyeem kab ntawv no ua ntej yuav khoom dab tsi. Yog li koj yuav xav tau:

  • Adafruit Trinket 5V (https://www.adafruit.com/product/1501)
  • Ib lub khob cij (https://www.adafruit.com/product/64)
  • Qee lub xov hlau jumper (https://www.adafruit.com/product/153)
  • 4k7 ohm resistor (https://www.adafruit.com/product/2783)
  • Ib daim ntawv velostat (https://www.adafruit.com/product/1361)
  • Peb cov hlua LED (https://www.adafruit.com/product/2237)
  • Lub hwj chim (https://www.adafruit.com/product/1466)
  • Thiab ntawm chav kawm me ntsis ntawm kab xev, txhuas ntawv ci thiab daim ntawv nyias nyias
  • Qee cov cuab yeej zoo li pliers, txiab thiab hlau txuas.
  • Me ntsis kab xev hluav taws xob thiab kab xev kapton.
  • Ib daim ntaub pua tsev !!!

Raws li koj tej zaum tuaj yeem pom kuv yog tus kiv cua loj ntawm Adafruit cov khoom, txawm li cas los xij koj tuaj yeem siv lwm cov qauv LED sawb. Qhov no yog nyob ntawm koj, kuv tus lej muaj ntau txoj kev xaiv muaj. Hauv kuv qhov teeb tsa kuv siv 50 LED SM16716 cov qauv, xav tias dawb siv ntau lub teeb raws li koj xav tau thiab txhua tus qauv kev cai txhawb nqa. Tab sis xav txog lub zog tsim nyog rau koj teeb tsa, nco ntsoov tias feem ntau rgb strips tuaj yeem xav tau ntau npaum li 60 mA ib LED. Yog li koj tau ceeb toom!

Kauj Ruam 2: Ua Lub Sensor Rug

Image
Image
Ua lub Sensor Rug
Ua lub Sensor Rug
Ua lub Sensor Rug
Ua lub Sensor Rug

Qhov no yog qhov ntev tshaj plaws ntawm qhov kev qhia no, tab sis nws yooj yim. Thov siv cov duab ua siv thiab ua raws cov kauj ruam no:

  1. Txiav ob daim ntawv txhuas ntawv me ntsis me dua daim ntawv velostat.
  2. Tom qab ntawd siv qee daim kab xev hluav taws xob los koom nrog 3 nplooj ntawv, nco ntsoov tias nyob hauv nruab nrab mus rau daim ntawv velostat. Kuj cia qhov chaw me me tsis muaj kab xev rau qhov thaiv.
  3. Siv qee tus tooj liab tapper los tsim hluav taws xob tiv tauj, ib qho mus rau hauv qab cov ntawv txhuas thiab lwm qhov nyob rau sab saum toj.
  4. Siv cov xaim xaim txuas rau daim kab xev tooj liab txuas thiab siv qee daim kab xev kapton los tiv thaiv kev sib txuas.
  5. Tom qab ntawd siv daim ntawv nyias nyias los ntawm kev tiv thaiv cov ntawv ci txhuas los ntawm ripping, cov ntawv no yuav tsum yog qhov loj ib yam li tag nrho cov ntsuas. Ruaj nws nrog daim kab xev hluav taws xob ntau dua. Kuj yuav tsum ceev faj ntawm qhov chaw me me tsis muaj kab xev lossis ua lub qhov me me nyob rau hauv ob qho tib si txhuas thiab duab los qhia kom huab cua khiav tawm yam tsis ua kev puas tsuaj rau lub ntsuas cua.
  6. Puas yog txhua yam yog qhov zoo koj tam sim no muaj lub luag haujlwm ua haujlwm nce qib sensor !!!

Nco tseg: Kuv siv lub hnab yas uas tuaj nrog daim ntawv velostat los tiv thaiv lub ntsuas cua los ntawm cov av noo, tsuas yog plam nws hauv:)

Kauj Ruam 3: Mount LED Sawb ntawm Koj Lub Txaj

Mount LED Sawb ntawm Koj Lub Txaj
Mount LED Sawb ntawm Koj Lub Txaj

Tam sim no cia peb mus rau qhov lom zem ntawm txoj haujlwm no, txuas koj lub teeb rau koj lub txaj !!! Kuv yuav tsis nkag mus rau hauv cov ntsiab lus ntau nrog qhov no, tsuas yog muaj tswv yim thiab ua raws li koj xav tau. Tab sis yog tias koj xav tau kev tshoov siab me ntsis kuv tso cov mines txhua ob peb centimeters thiab kuv tau siv daim kab xev npog los kho nws lub txaj.

Xav tias siv ntau Leds raws li koj xav tau, hauv txoj haujlwm thiab nrug koj xav tau:)

Kauj Ruam 4: Program Trinket

Program lub Trinket
Program lub Trinket

Okay, ua ntej tshaj plaws koj yuav tsum tau kawm paub siv Trinket li cas. Luckily adafruit muaj kev qhia zoo nyob ntawm no. Thaum koj npaj tau rov qab los rau qhov ua.

Kuv pom, koj tau rov qab los. Tam sim no koj paub yuav ua li cas thauj cov program mus rau Trinket nrog Arduino thiab cov hauv paus, tej zaum koj tau ua tiav Blinky demo:)

Tam sim no rub tawm lub tsev qiv ntawv FastLED zoo los ntawm GitHub thiab nruab nws. Thiab tom qab ntawd muab kuv cov lej tso rau hauv koj lub trinket, tau ua haujlwm kom tig lub LED hauv xiav nrog cov duab me me. Tab sis xav tias yuav hloov kho ib qho twg koj xav tau, nco ntsoov teeb tsa tus lej ntawm cov coj koj siv thiab hom kab txaij.

// Qhov haujlwm no tau tsim los ntawm Danni Fernandez #suav nrog #include "FastLED.h" #fine NUM_LEDS 50 // muaj pes tsawg leds koj cov kab txaij muaj #txhais DATA_PIN 0 // kab ntawv rau koj kab txaij #define CLOCK_PIN 1 // moos kab rau koj txoj hlua, yog koj txoj hlua tsis muaj cov lus hais nws#txhais SENSOR_PIN 1 // qhov twg lub sensor txuas nrog, ntawm adafruit trinket analog pin 1 sib npaug rau tus lej digital 2#txhais TRIGGER 50 // tus nqi hauv qab no xav txog ib tus neeg tab tom nqis tes CRGB coj [NUM_LEDS]; int inicialization = 0; int xeev = 0; void teeb () {yog (F_CPU == 16000000) clock_prescale_set (clock_div_1); // qhov twg xav tau lub pob tw khiav ntawm 16MHZ, thov tseem xaiv nws ntawm cov ntawv qhia zaub mov // Tsis pom zoo/kho ib qho ntawm kab hauv qab no rau koj cov hlua coj uas koj siv // FastLED.addLeds (leds, NUM_LEDS); // FastLED.addLeds (leds, NUM_LEDS); // FastLED.addLeds (leds, NUM_LEDS); // FastLED.addLeds (leds, NUM_LEDS); // FastLED.addLeds (leds, NUM_LEDS); // FastLED.addLeds (leds, NUM_LEDS); //FastLED.addLeds(leds, NUM_LEDS); // FastLED.addLeds (leds, NUM_LEDS); // FastLED.addLeds (leds, NUM_LEDS); // FastLED.addLeds (leds, NUM_LEDS); // FastLED.addLeds (leds, NUM_LEDS); // FastLED.addLeds (leds, NUM_LEDS); // FastLED.addLeds (leds, NUM_LEDS); // FastLED.addLeds (leds, NUM_LEDS); // FastLED.addLeds (leds, NUM_LEDS); // FastLED.addLeds (leds, NUM_LEDS); // FastLED.addLeds (leds, NUM_LEDS); // FastLED.addLeds (leds, NUM_LEDS); // FastLED.addLeds (leds, NUM_LEDS); FastLED.addLeds (leds, NUM_LEDS); // hauv kuv rooj plaub no yog kuv tus qauv qauv // FastLED.addLeds (leds, NUM_LEDS); // FastLED.addLeds (leds, NUM_LEDS); // FastLED.addLeds (leds, NUM_LEDS); // FastLED.addLeds (leds, NUM_LEDS); kev raug cai = 1; ncua (500);} void loop () {if (inicialization == 1) // tua tag nrho cov leds hauv hwj chim rau {rau (int i = 0; kuv <NUM_LEDS; i ++) {leds .setRGB (0, 0, 0); } FastLED.show (); kev raug cai = 0; FastLED.show (); } yog (analogRead (SENSOR_PIN) <= TRIGGER) // yog tias ib tus neeg nyob rau ntawm cov ntaub pua plag {yog (xeev == 0) // yog cov leds raug kaw ces ua cov duab no rau tig rau {rau (int i = 0; i < NUM_LEDS; kuv ++) {leds .setRGB (0, 0, 20); FastLED.show (); ncua (100); } ncua (200); rau (int x = 20; x <= 125; x ++) {rau (int i = 0; kuv <NUM_LEDS; kuv ++) {leds .setRGB (0, 0, x); } FastLED.show (); ncua (20); } thaum (analogRead (SENSOR_PIN) = 20; x--) {rau (int i = 0; i = 0; i--) {leds .setRGB (0, 0, 0); FastLED.show (); ncua (100); } thaum (analogRead (SENSOR_PIN) <= TRIGGER); // tos kom txog thaum tus neeg tawm mus qeeb (2000); xeev = 0; }} ncua (200);}

Txog qhov kawg ntawm txoj cai tau txais nws ntawm GitHub:

Kauj Ruam 5: Ua Lub Circuit Court

Ua Circuit Court
Ua Circuit Court

Nws yog ib qho yooj yim Circuit Court, yog li nws tsuas yog siv ob peb feeb los ua qhov no hauv peb daim ntawv qhia zaub mov,:)

Kuv cov kev sib txuas yog raws li hauv qab no:

  • 5V los ntawm lub zog xa mus rau BAT tus pin ntawm Trinket thiab Vcc ntawm peb cov hlua LED.
  • GND los ntawm lub zog xa mus rau Trinket, ib txoj hlua ntawm peb cov ntaub pua plag sensor thiab GND ntawm LED sawb.
  • Trinket tus pin 0 rau cov ntaub ntawv tus pin ntawm LED Sawb.
  • Trinket tus pin 1 rau moos tus pin ntawm LED Sawb.
  • Lwm cov hlau ntawm cov ntaub pua plag sensor mus rau Trinket tus pin 2, kuj yog 4k7 ohm resistor mus nruab nrab ntawm tus pin no thiab 5V tus pin ntawm Trinket.

Qhov ntawd yog txhua yam, koj tsis xav li cas?

Kauj Ruam 6: Txaus siab rau !

Txaus siab rau !!!
Txaus siab rau !!!

Nkaum txhua yam hauv qab koj lub txaj thiab tso lub ntsuas cua nyob hauv qab ntaub pua tsev. Tam sim no koj npaj txhij los tsoo qhov haujlwm no.

Kuv vam tias koj txaus siab rau nws thiab ua ntau hacking nrog cov animations thiab teeb pom kev zoo.

Ua tsaug rau koj nyeem kuv:)

Pom zoo: