Cov txheej txheem:

Crystal House: 5 Kauj Ruam
Crystal House: 5 Kauj Ruam

Video: Crystal House: 5 Kauj Ruam

Video: Crystal House: 5 Kauj Ruam
Video: Christina Aguilera - Beautiful (Official HD Video) 2024, Hlis ntuj nqeg
Anonim
Image
Image
Tsev Crystal
Tsev Crystal

Cov khub niam txiv thiab tsev neeg uas tau sib cais vim nyob deb deb feem ntau xav tias xav tau kev sib txuas. Lub Tsev Crystal tau tsim rau khub niam txiv thiab tsev neeg sib txuas ua ke los ntawm teeb. Lub Tsev Crystal tau txuas nrog cov cim wifi. Thaum koj nias lub pob ntawm ib lub tsev Crystal, lwm lub Crystal House lub teeb tau txais lub teeb liab thiab yuav qhib. Nws yog ib qho yooj yim thiab lom zem ua! Kuv yuav dhau los ntawm ib qib zuj zus los ntawm cov ntaub ntawv/cov cuab yeej siv, kev tsim/sim Circuit siv Arduino thiab tsim cov qauv ntawm Crystal House

Kauj Ruam 1: Qhov Chaw, Cov Cuab Yeej, Cov Khoom Siv

  • Sib dhos Feather Huzzah ESP8266 (ob)
  • Perma-Proto Half-sized breadboard (ob)
  • Lithium roj teeb -3.7 1200mAh (ob)
  • Mini On/Off Push-Button Switch (plaub)
  • NeoPixel Mini Khawm (plaub)
  • Breadboard Hlau
  • Soldering Hlau & Solder
  • Hlau stripper
  • Peb tes cuab yeej
  • Ntoo ntoo lo
  • Acrylic ntawv
  • Ntshiab pob zeb
  • Ntawv pob tshab
  • Super kua nplaum

Kauj Ruam 2: Daim Duab Circuit Court thiab Code

Circuit Diagram thiab Code
Circuit Diagram thiab Code

// Cov Lus Qhia Hauv Is Taws Nem ntawm Yam Chav Kawm piv txwv tus lej // Ua ke cov tswv yim thiab cov txiaj ntsig // Ob lub pob nyem xa cov lus txib mus rau AIO pub // LED thiab lub zog vibrating (lossis ib qho tso tawm digital) flah/buzz raws li pub cov ntaub ntawv // // Hloov kho los ntawm Becky Stern 2017 // raws li piv txwv los ntawm Adafruit IO Arduino Library: // https://github.com/adafruit/Adafruit_IO_Arduino // // Adafruit nqis peev sijhawm thiab peev txheej muab qhov qhib qhov chaws no. // Thov txhawb Adafruit thiab qhib qhov khoom kho vajtse los ntawm kev yuav khoom // cov khoom lag luam los ntawm Adafruit! // // Sau los ntawm Todd Treece rau Adafruit Industries // Copyright (c) 2016 Adafruit Industries // Muaj ntawv tso cai raws li MIT daim ntawv tso cai // // Txhua cov ntawv sau saum toj no yuav tsum suav nrog txhua qhov kev faib tawm. #suav nrog

  1. #define NeoPIN1 15

    // Parameter 1 = tus lej pixels hauv kab txaij // Parameter 2 = Arduino tus lej tus lej (feem ntau siv tau) // Parameter 3 = pixel hom chij, ntxiv ua ke raws li xav tau: // NEO_KHZ800 800 KHz bitstream (feem ntau NeoPixel cov khoom w/WS2812 LEDs) // NEO_KHZ400 400 KHz (classic 'v1' (tsis v2) FLORA pixels, WS2811 tsav tsheb) // NEO_GRB Pixels tau txuas rau GRB bitstream (feem ntau NeoPixel khoom) // NEO_RGB Pixels tau txuas rau RGB bitstream (v1 FLORA pixels, tsis v2) // NEO_RGBW Pixels tau txuas rau RGBW bitstream (NeoPixel RGBW cov khoom) Adafruit_NeoPixel sawb = Adafruit_NeoPixel (2, NeoPIN1, NEO_GRB + NEO_KHZ800);

    /************************ Adafruit IO Configuration ********************** *********

    / mus ntsib io.adafruit.com yog tias koj xav tsim tus as khauj, // lossis yog koj xav tau koj li Adafruit IO tus yuam sij. #define IO_USERNAME "Koj lub npe siv" #define IO_KEY "Koj IO_KEY"

    /******************************* WIFI Configuration **************** **********************/

    #define WIFI_SSID "Koj li wifi" #define WIFI_PASS "Koj tus password"

    #suav nrog "AdafruitIO_WiFi.h" AdafruitIO_WiFi io (IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);

    /************************ Txoj Cai Tseem Ceeb Pib Ntawm no ********************* **********/

    #include #include #include #include

    // #define LED_PIN 15 #define BUTTON1_PIN 4 #define BUTTON2_PIN 14 // #txhais MOTOR_PIN 5 // tus pin no xav tau PWM peev xwm

    // khawm lub xeev int button1current = 0; int button1last = 0; int khawm2current = 0; int button2last = 0;

    // teeb tsa 'digital' pub AdafruitIO_Feed *hais kom ua = io.feed ("hais kom ua"); AdafruitIO_Feed *command2 = io.feed ("command2");

    teeb tsa tsis muaj dabtsis () {strip.setBrightness (60); strip.begin (); strip.show (); // Pib tag nrho cov pixels rau 'tawm' // teeb tsa tus pin pins raws li cov tswv yim nrog sab hauv rub-up resistor pinMode (BUTTON1_PIN, INPUT_PULLUP); pinMode (BUTTON2_PIN, INPUT_PULLUP); // teeb tsa tus pin thiab lub cev muaj zog pin raws li cov lej tawm // pinMode (MOTOR_PIN, OUTPUT); // pinMode (LED_PIN, OUTPUT);

    // pib qhov txuas txuas Serial.begin (115200);

    // txuas rau io.adafruit.com Serial.print ("Txuas rau Adafruit IO"); io.connect (); // teeb tsa tus tuav tes xov rau 'hais kom ua' pub. // kev ua haujlwm handleMessage (txhais hauv qab no) // yuav raug hu thaum twg cov lus tau txais // tau txais los ntawm adafruit io. command-> onMessage (handleButton1); command2-> onMessage (handleButton2);

    // tos kev txuas thaum (io.status () <AIO_CONNECTED) {Serial.print ("."); ncua (500); }

    // peb txuas nrog Serial.println (); Serial.println (io.statusText ());

    // xyuas kom txhua qhov pub mis tau txais lawv cov txiaj ntsig tam sim tam sim ntawd hais kom ua-> tau (); command2-> tau (); }

    void voj () {

    // io.run (); yuav tsum muaj rau txhua daim duab. // nws yuav tsum ib txwm nyob rau saum koj lub voj // ua haujlwm. nws ua rau cov neeg siv txuas nrog // io.adafruit.com, thiab ua haujlwm cov ntaub ntawv nkag. io.run ();

    // tuav lub xeev tam sim no ntawm lub pob. // peb yuav tsum tig lub logic vim tias peb // siv INPUT_PULLUP. yog (digitalRead (BUTTON1_PIN) == LOW) {button1current = 1; } yog (digitalRead (BUTTON2_PIN) == LOW) {button2current = 1; } yog (digitalRead (BUTTON2_PIN) == HIGH && digitalRead (BUTTON1_PIN) == HIGH) {button1current = 0; button2 tam sim no = 0; }

    // rov qab yog tias tus nqi tsis hloov pauv yog tias (button1current == button1last && button2current == button2last) rov qab;

    // txuag lub xeev tam sim no rau 'digital' pub ntawm adafruit io Serial.print ("xa khawm 1 xwm txheej ->"); Serial.println (button1current); command-> txuag (button1current);

    // txuag lub xeev tam sim no rau 'digital' pub ntawm adafruit io Serial.print ("xa khawm 2 xwm txheej ->"); Serial.println (button2current); command2-> txuag (button2current);

    // khaws lub xeev khawm kawg button1last = button1current; button2last = button2 tam sim no; }

    // txoj haujlwm no raug hu thaum twg los xij 'lus txib' lus // tau txais los ntawm Adafruit IO. nws tau txuas nrog // cov lus txib pub hauv teeb tsa () ua haujlwm saum toj no. tsis muaj nuj nqis handleButton1 (AdafruitIO_Data *cov ntaub ntawv) {

    int hais kom ua = data-> toInt ();

    yog (hais kom ua == 1) {// pom thawj pixel Serial.print ("tau txais los ntawm kev hais kom ua (khawm 1) <-"); Serial.println (hais kom ua); // analogWrite (MOTOR_PIN, 200); // ncua (500); // analogWrite (MOTOR_PIN, 0); strip.setPixelColor (0, strip. Color (200, 100, 0)); // Yellow strip.show (); } lwm {Serial.print ("tau txais los ntawm kev hais kom ua (khawm 1) <-"); Serial.println (hais kom ua); strip.setPixelColor (0, strip. Color (0, 0, 0)); // tawm strip.show (); }} // txoj haujlwm no raug hu thaum twg los xij 'hais kom ua' cov lus // tau txais los ntawm Adafruit IO. nws tau txuas nrog // cov lus txib pub hauv teeb tsa () ua haujlwm saum toj no. tsis muaj nuj nqis handleButton2 (AdafruitIO_Data *cov ntaub ntawv) {

    int command2 = data-> toInt ();

    yog tias (command2 == 1) {// teeb tsa thawj pixel Serial.print ("tau txais los ntawm command2 (khawm 2) <-"); Serial.println (command2); // analogWrite (MOTOR_PIN, 200); // ncua (500); // analogWrite (MOTOR_PIN, 0); strip.setPixelColor (1, strip. Color (255, 128, 128)); // Yellow strip.show (); } lwm {Serial.print ("tau txais los ntawm command2 (khawm 2) <-"); Serial.println (command2); strip.setPixelColor (1, strip. Color (0, 0, 0)); // tawm strip.show (); }}

Kauj Ruam 3: Kev Tsim Kho Vaj Huam Sib Luag Los Ntawm Cov Qauv Mus Rau Qhov Muag

Kev Tsim Kho Vaj Huam Sib Luag Los Ntawm Cov Qauv Mus Rau Qhov Muag
Kev Tsim Kho Vaj Huam Sib Luag Los Ntawm Cov Qauv Mus Rau Qhov Muag
Kev Tsim Kho Vaj Huam Sib Luag Los Ntawm Cov Qauv Mus Rau Qhov Muag
Kev Tsim Kho Vaj Huam Sib Luag Los Ntawm Cov Qauv Mus Rau Qhov Muag

Kuv yuav txhawb koj kom sim ntawm lub khob cij los ntsuas qhov Circuit. Txij li thaum peb tab tom tsim ob lub cuab yeej, peb tuaj yeem sim ntawm ob lub khob cij. Kuv tau siv lub Neopixel thiab khawm on.off mus rau lub xov hlau qauv vim nws yooj yim siv. Tom qab ntawd, koj tuaj yeem yooj yim txuas cov kab hluav taws xob tiv thaiv.

Tom qab peb ua tiav nrog kev tsim qauv Circuit Court, nws yog lub sijhawm los tsim peb qhov Circuit tiag. Kuv tab tom siv daim ntawv Perma-proto breadboard vim nws me dua thiab kev sib txuas ntawm lub Circuit Court yuav zoo dua li daim phiaj prototyping. Thaum nws los rau hauv cov laug, nws yuav tsum tau ua siab ntev ntau. Tsis txhob tso tseg! Koj mus txog ntawd!

Thaum koj ua tiav koj lub Circuit Court thiab tso cov cai nkag rau hauv koj li ESP8266, ob lub cuab yeej yuav tsum ua haujlwm zoo li peb tau hais thaum pib.

Kauj Ruam 4: Daim Ntawv & Khoom Siv

Daim Ntawv & Khoom
Daim Ntawv & Khoom
Daim Ntawv & Khoom
Daim Ntawv & Khoom
Daim Ntawv & Khoom
Daim Ntawv & Khoom
Daim Ntawv & Khoom
Daim Ntawv & Khoom

Tam sim no cia peb ua peb Lub Tsev Crystal!

Txiav ntoo lo rau hauv 6 nti. Peb xav tau 18 daim nyob rau hauv tag nrho. Txij li thaum kuv xav tau qee qhov kev hloov pauv ntawm ob lub tsev siv lead ua no, Kuv tau siv 7 daim hauv ib qho thiab 9 daim ntawm lwm qhov. Muab cov khoom tso rau hauv lub thawv ntawv. Kuv txiav ob daim ntawv acrylic rau 6 los ntawm 6 ntiv tes thiab muab lawv tso rau hauv qab ntawm Crystal House.

Thaum koj ua tiav cov qauv tsev. Cia peb kho lub tsev! Kuv txiav ib daim ntawv ntawm daim ntawv dawb paug xim thiab lo rau lawv rau ntawm daim ntawv acrylic. Tom qab ntawd, Kuv tau siv qee cov yas yas uas muaj tseeb thiab muab lo rau saum lub hauv paus. Txij li thaum kuv muaj daim ntawv xim dawb nyob hauv qab ntawm cov muaju, cov muaju tau pom rau xim sib txawv.

Kauj Ruam 5: Tam sim no Cia Peb Siv Lub Tsev Crystal

Tam sim no Cia Peb Siv Lub Tsev Crystal
Tam sim no Cia Peb Siv Lub Tsev Crystal
Tam sim no Cia Peb Siv Lub Tsev Crystal
Tam sim no Cia Peb Siv Lub Tsev Crystal

Muab koj tus hlub ib lub tsev siv lead ua koj tau ua. Qhia lawv tias lawv tseem ceeb! Koj tuaj yeem hloov kho tus qauv sab nrauv siv cov khoom sib txawv thiab xim. Qhia rau kuv paub nws mus li cas!

Pom zoo: