Cov txheej txheem:

O-Zone: DIY Bluetooth Roj Teeb Teeb: 4 Kauj Ruam (nrog Duab)
O-Zone: DIY Bluetooth Roj Teeb Teeb: 4 Kauj Ruam (nrog Duab)

Video: O-Zone: DIY Bluetooth Roj Teeb Teeb: 4 Kauj Ruam (nrog Duab)

Video: O-Zone: DIY Bluetooth Roj Teeb Teeb: 4 Kauj Ruam (nrog Duab)
Video: ? Что такое многополосный 6 атомный хронометраж ? То 2024, Hlis ntuj nqeg
Anonim
Image
Image

O-Zone yog DIY teeb Bluetooth. Koj tuaj yeem hloov kho xim ntawm lub teeb thiab tseem qhov ci ntawm cov coj. Koj tuaj yeem siv koj lub xov tooj ntawm tes, koj lub ntsiav tshuaj los hloov ON lub teeb, hloov xim thiab kev xav ntawm koj chav.

Cov ntaub ntawv rau lub teeb yog:

1 x Lub teeb BlueBean nrog roj teeb

1 x Adafruit Neopixel nplhaib (16 x leds)

Handy Bluetooth app iOS

Bluethooth Terminal rau Android

Cov ntaub ntawv rau tus qauv yog:

3 hli (3.1 nti) Ntoo

1.5 hli (0.05 nti) Dawb Plexiglass

Kauj Ruam 1: Tus Qauv ntawm Lub Voos Xwmfab

Program Punch Through Light Blue Bean
Program Punch Through Light Blue Bean

Txog tus qauv ntawm lub teeb, Kuv tau tsim lub voos xwmfab. Ib qho yooj yim tab sis tawm ntoo lub voos xwmfab. Kuv tau txiav ntoo nrog kuv lub laser engraver. Tsis tas li, kuv tau txiav lub voj voog sab hauv lub ntsej muag sab saud ntawm lub voos xwmfab. Sab hauv kev txiav, Kuv tau muab lub nplhaib plexiglass dawb. Kuv txiav lub plexiglass nrog 40W laser txiav. Koj tuaj yeem siv lub plexiglass dawb, raws li Adafruit coj lub nplhaib, muaj ntau xim. Tsis tas li, koj tuaj yeem siv Plexi pob tshab, tab sis kuv xav tias dawb zoo dua rau qhov ua kom zoo ntawm lub teeb.

Txog kev txiav cov qauv, koj tuaj yeem siv koj lub tshuab txiav laser lossis koj tuaj yeem siv qhov kev txiav laser zoo li Fablab lossis tseem koj tuaj yeem xa qhov haujlwm mus rau kev pabcuam online zoo li Shapeways.

Muab cov khoom ua ke nrog cov yas nplaum. Tom qab sib dhos lub nplhaib Adafruit Neopixel nrog lub nplhaib plexiglass. Rau cov khoom yas, koj tuaj yeem siv cov kua nplaum acrylic. Sib dhos ua ke.

Tom qab cov kauj ruam no, koj cov qauv npaj txhij!

Kauj Ruam 2: Ua Haujlwm Punch Los Ntawm Lub Teeb Blue Bean

Rau kev teeb tsa Lub Teeb BlueBean koj tuaj yeem siv Arduino IDE. Thaum koj them lub firmware ntawm koj Lub Teeb BlueBean koj yuav tsum siv Bluetooth sib txuas lus. Koj tuaj yeem siv Arduino IDE thiab ua ke cov haujlwm no nrog Punch Trough Light BlueBean loader. Saib hauv lub vev xaib raug cai kom paub meej.

Pib Nrog Teeb BLUEBean

Koj tuaj yeem siv tus lej no rau Light BlueBean:

/* ******************************************

* O-tsam Bluethooth Teeb

* Lub Peb Hlis 31, 2017

* Giovanni Lwm Haiv Neeg

* rau Punch Los Ntawm Lub Teeb BlueBean

**********************************************/

#suav nrog "Adafruit_NeoPixel.h"

// Tus pin uas txuas nrog NeoPixels

#Txhais tus lej PIN 5

// Tus nqi ntawm LEDs hauv NeoPixels

#define NUMPIXELS 16 int kaj = 20; boolean lumi = 1; boolean yav dhau losLumi = 1;

Txoj hlua hais kom ua;

boolean commandStarted = cuav; Adafruit_NeoPixel pixels = Adafruit_NeoPixel (NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); LedReading ledColor; LedReading yav dhau losLedColor; teeb tsa tsis muaj dabtsis () {Serial.begin (); // Pib ua NeoPixels pixels.begin (); }

void voj () {

getCommand (); }

/*

Txoj haujlwm no nyeem qhov chaw nres nkoj thiab txheeb xyuas lub cim pib '#' yog lub cim pib yog pom nws yuav ntxiv txhua tus cim tau txais rau qhov hais kom ua kom txog thaum nws tau txais cov lus txib kawg ';' Thaum qhov kawg hais kom ua tau txais qhov hais kom ua tiav () muaj nuj nqi. yog pom tus cim thib ob pom ua ntej tus ua cim xaus tom qab ntawd qhov tsis raug tshem tawm thiab cov txheej txheem pib dua. */ void getCommand () {thaum (Serial.available ()) {char newChar = (char) Serial.read (); yog (newChar == '#') {commandStarted = tseeb; hais kom = "\ 0"; } lwm yog (newChar == ';') {commandStarted = cuav; hais kom ua tiav (); hais kom ua = "\ 0"; } lwm yog (commandStarted == muaj tseeb) {hais kom ua += newChar; }}}

/*

Txoj haujlwm no siv cov lus txib ua tiav thiab tshawb xyuas nws tawm tsam cov npe ntawm cov lus txib muaj thiab ua raws txoj cai tsim nyog. Ntxiv cov lus 'yog' ntxiv cov lus txib nrog cov cai koj xav kom ua thaum cov lus txib ntawd tau txais. Nws raug pom zoo los tsim txoj haujlwm rau kev hais kom ua yog tias muaj ntau dua ob peb kab ntawm cov cai rau raws li hauv qhov 'tawm' piv txwv. */ void commandCompleted () {if (command == "low") {ci = ci - 10; lus = -lumi; Serial.print (ci ntsa iab); } yog (hais kom ua == "siab") {ci = ci + 10; lus = -lumi; Serial.print (ci ntsa iab); } yog (hais kom ua == "liab") {Bean.setLed (255, 0, 0); Serial.print ("LED tig liab"); } yog (hais kom ua == "ntsuab") {Bean.setLed (0, 255, 0); Serial.print ("LED tig ntsuab"); } yog (hais kom ua == "xiav") {Bean.setLed (0, 0, 255); Serial.print ("LED tig xiav"); } yog (hais kom ua == "daj") {Bean.setLed (255, 255, 0); Serial.print ("LED tig daj"); } yog (hais kom ua == "txiv kab ntxwv") {Bean.setLed (255, 60, 0); Serial.print ("LED tig txiv kab ntxwv"); } yog (hais kom ua == "ntshav") {Bean.setLed (128, 0, 128); Serial.print ("LED hloov ntshav"); } yog (hais kom ua == "dawb") {Bean.setLed (255, 255, 255); Serial.print ("LED tig dawb"); } yog (hais kom ua == "tawm") {tawm (); } yog (Bean.getConnectionState ()) {// Tau txais qhov tseem ceeb los ntawm Bean's onboard LED ledColor = Bean.getLed (); } yog (lumi! = yav dhau losLumi || ledColor.red! = yav dhau losLedColor.red || ledColor.green! = yav dhau losLedColor.green || ledColor.blue! = yav dhau losLedColor.blue) {rau (int i = 0; i

/*

Siv cais ua haujlwm zoo li no thaum muaj ntau dua li ob peb kab ntawm cov cai. Qhov no yuav pab tswj kom huv yooj yim nyeem cov cai. */ void off () {Bean.setLed (0, 0, 0); Serial.print ("LED tua"); }

Kauj Ruam 3: Txuas Lub Teeb Blue Bean rau Adafruit Neopixel Ring

Txuas lub Teeb Blue Bean rau Adafruit Neopixel Ring
Txuas lub Teeb Blue Bean rau Adafruit Neopixel Ring

Tom qab rub tawm cov firmware, koj tuaj yeem siv Lub Teeb BlueBean nrog koj lub smartphone. Koj tuaj yeem sim qhov program los ntawm kev siv rgb coj los rau hauv. Tom qab koj tuaj yeem txuas Adafruit 16x lub nplhaib.

Them nyiaj mloog, txuas VCC mus rau Lub Teeb BlueBean 5v, GND rau Lub Teeb BlueBean GND thiab cov ntaub ntawv tus lej ntawm koj Adafruit Neopixel ntiv nplhaib ntawm tus lej 5

Kauj Ruam 4: Bluetooth App thiab Kev Sib Txuas Txuas

Bluetooth app thiab kev sib txuas lus txuas
Bluetooth app thiab kev sib txuas lus txuas

Cov cai sab hauv Lub Teeb BlueBean tau txais cov ntaub ntawv los ntawm cov lej. Koj tuaj yeem xa cov kab ntawv txuas mus rau BlueBean los ntawm kev siv Bluetooth raws tu qauv. Kuv siv Handy BLE rau iOS. Koj tuaj yeem siv daim ntawv thov no xa los ntawm Bluetooth raws tu qauv kab ntawv txuas uas koj xav tau. Kuv tau tsim lub dashboard uas muaj 6 lub voj voos xim, 1 Tawm lub voj voos, thiab ob lub ntsej muag ci. Cov lus txib plaub yog rau tso thiab nqis qhov ci ntawm lub teeb ci.

Cov lus txib uas BlueBean lees txais yog:

Rau coloring leds:

#liab;

#Ntshav;

#xiav;

#ntsuab;

#yog;

#txiv kab ntxwv;

Rau kaw cov leds:

#tawm;

Rau kev tswj qhov ci ntsa iab:

#qis;

#siab;

Pom zoo: