Cov txheej txheem:

Cov Kab Hlau Rhuav Hauv Tsev - Mini Project Nrog MakerChips 'BluChip (nRF51 BLE) Module: 7 Kauj Ruam (nrog Duab)
Cov Kab Hlau Rhuav Hauv Tsev - Mini Project Nrog MakerChips 'BluChip (nRF51 BLE) Module: 7 Kauj Ruam (nrog Duab)

Video: Cov Kab Hlau Rhuav Hauv Tsev - Mini Project Nrog MakerChips 'BluChip (nRF51 BLE) Module: 7 Kauj Ruam (nrog Duab)

Video: Cov Kab Hlau Rhuav Hauv Tsev - Mini Project Nrog MakerChips 'BluChip (nRF51 BLE) Module: 7 Kauj Ruam (nrog Duab)
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Kaum ib hlis
Anonim
Cov Kab Hlau Rhuav Hauv Tsev - Mini Project Nrog MakerChips 'BluChip (nRF51 BLE) Module
Cov Kab Hlau Rhuav Hauv Tsev - Mini Project Nrog MakerChips 'BluChip (nRF51 BLE) Module

Xav txog qhov xav tsis thoob thiab xav kom tau txais lub teeb ci ntawm tshav ntuj los ntawm koj lub qhov rais, lossis kaw cov ntaub thaiv kom koj tuaj yeem tsaug zog ntxiv, yam tsis tau siv koj tus kheej kom ze rau ntawm daim ntaub tab sis zoo li kov lub pob ntawm koj lub xov tooj. Nrog Automated Tsev Kab Hlau Kab Hauv Tsev, koj ua tiav qhov no nrog cov khoom siv uas tsis raug nqi ntau dua $ 90!

Saib qhov kev qhia no ntawm Github

Kauj Ruam 1: Tus Tsim

Tsim
Tsim

Hauv plawv ntawm Automated Home Curtain System yog MakerChips 'BluChip module.

BluChip yog qhov me me 16.6x11.15mm Bluetooth module uas tuaj yeem ua haujlwm ib puag ncig rau cov xov tooj ntawm BTLE.

Nyem rau qhov no rau kev qhia rau Bluetooth Tsawg Zog (BTLE).

Cov qauv suav nrog nRF51 SoC los ntawm Nordic Semiconductors, lub platform zoo rau BLE daim ntawv thov vim nws txhawb ntau yam sib xyaw ua ke ntawm ob qho Android thiab Apple apps.

Kauj Ruam 2: Cov Khoom Siv BluChip Explorer

BluChip Explorer Cov Khoom
BluChip Explorer Cov Khoom
BluChip Explorer Cov Khoom
BluChip Explorer Cov Khoom
BluChip Explorer Cov Khoom
BluChip Explorer Cov Khoom

Txhawm rau tsim txoj haujlwm no, Kuv tau txais BluChip Explorer Kit los ntawm MakerChips uas tuaj txog hauv 2 lub thawv cais, ib qho rau CMSIS-DAP programmer thiab lwm lub thawv uas muaj BluChip ntawm lub khob cij nrog 2 RGB LEDs, yees duab-tiv thaiv thiab roj teeb CR2032.

Raws li koj tau pom, BluChip module yog qhov me me heev, ua rau nws zoo meej rau qhov ua haujlwm me me uas tsis muaj zog Bluetooth. Nws haum rau tus hneev taw ntawm tsuas yog 6x4 0.1 "headers ntawm lub khob cij thiab muaj ntxiv 0.05" headers nyob rau sab saum toj ntawm lub rooj tsavxwm, zoo nkauj heev rau kev lag luam FCC ntawv pov thawj pob!

Nov yog qee qhov tseem ceeb ntawm BluChip los ntawm MakerChips lub vev xaib:

  • 14 nkag tau yooj yim GPIO Pins
  • ARM Cortex M0 32 ntsis processor thiab 256KB flash thiab 32KB RAM
  • 16.6 mm x 11.15 mm Me me qhob cij-boardable Bluetooth ® module muaj
  • Fais fab mov txhawb 1.8V - 3.6V
  • Nta Bluetooth

    • BTLE - Bluetooth Tsawg Zog - (BLE, BT 4.1)
    • Bluetooth® thiab Nyij Pooj, FCC, IC tsim nyog
    • Kev koom ua ke 32 Mhz System Moos
    • Lub zog tso zis: +4dBm raug
    • Zaus: 2402 txog 2480 MHz

      Kev ua haujlwm siab tus qauv kav hlau txais xov

    • Ib Hom Bluetooth® Ntse Qhev/Xib Hwb
  • Txhawb kev cuam tshuam: SPI, UART, I2C thiab 8/9/10bit ADC
  • Ob pawg txheej txheem pins

    • .05 "headers kom yooj yim txuas rau CMSIS-DAP thiab J-Txuas cov cuab yeej
    • .1 "headers rau cuam tshuam nrog cov laug cam
  • Software tswj tau liab LED

Kauj Ruam 3: NRF Txuas App

Image
Image
NRF Txuas App
NRF Txuas App
NRF Txuas App
NRF Txuas App

Sai li koj pop qhib lub BluChip explorer lub thawv, koj pom nws los rau lub neej nrog ntsais muag LEDs, zoo nkauj heev pom, tsis yog nws?

Txhawm rau pom dab tsi hauv khw nrog tus qauv BLE no, cia peb mus tom ntej thiab teeb tsa nRF Txuas app los ntawm Google Ua Si lossis App Store.

Peb yuav txuas mus rau BluChip nrog peb lub xov tooj, yog li qhib lub nRF Txuas app, xauj los ntawm lub vijtsam tos txais, thiab coj mus rhaub kom qhib Bluetooth. Tom ntej no, coj mus rhaub Luam theej duab thiab koj yuav pom sai sai tias koj lub cuab yeej BluChip tau teev tseg hauv qab Scanner tab.

Ua ntej peb txuas mus rau BluChip, cia peb tau txais LED thiab tso nws rau ntawm lub khob cij tom ntej ntawm tus pin 026 (+ve) thiab 021 (-ve). LED yuav tsum ci tam sim ntawd vim tus pin 026 tawm 3.3V (logic qib HIGH) hos tus pin 021 yog logic LOW (Hauv av).

Mus tom ntej thiab coj mus rhaub txuas txhawm rau tsim kev sib txuas ntawm koj lub xov tooj smartphone thiab BluChip, uas tom qab ntawd coj koj mus rau lub cuab yeej cov neeg siv khoom tab hauv app.

BluChip tus thov kev pabcuam tab qhia tag nrho cov kev pabcuam muaj nyob ntawm koj lub cuab yeej. Qhov peb txaus siab nyob ntawm no yog BlueChip GPIO Kev Pabcuam (teev raws li Kev Pabcuam Tsis Paub). Coj mus rhaub rau nws thiab tom qab ntawd coj mus rhaub rau ntawm lub xub pwg nyom uas nyob ib sab ntawm GPIO Kev Coj Tus Cwj Pwm (teev raws li Tsis Paub Txog Tus Cwj Pwm).

Tus lej sau tus nqi yuav tshwm tuaj, muab qhov kev xaiv rau koj xa cov ntaub ntawv rau koj lub cuab yeej BluChip. Hauv peb qhov xwm txheej, peb xav tig lub LED tawm, yog li coj mus rhaub rau ntawm xub xub tom ntej ntawm BYTE ARRAY thiab hloov cov ntaub ntawv hom ntawv mus rau UINT 8. Peb yuav xa tus lej tus lej ua thawj tus nqi, yog li sau 21 rau tus pin021. Coj mus rhaub rau ntxiv tus nqi xa cov ntawv tom ntej, lub xeev uas tus pin yuav tsum tau teeb (hex BYTE hom ntawv). Txhawm rau tua lub LED, peb yuav teeb tus pin 021 rau 3.3V (qib siab lub logic siab), yog li nkag mus 01 ces coj mus Xa.

LED tua tam sim ntawd! Txhawm rau tig lub LED rov qab, xa tus nqi 0x00 (logic qib LOW) rau tus pin021. Raws li pom hauv qab cov yam ntxwv teev tseg, tus nqi xa ntawm (0x) 15-01 tau tshwm. {[(zauv UINT8) 21 = (hex BYTE) 0x15] + (hex BYTE) 0x01 => (hex BYTEs) 0x1501}

Yog tias koj xaiv khaws cov txiaj ntsig no ntawm Kev Sau Tus lej popup los ntawm kev muab nws lub npe thiab tom qab ntawd coj mus rhaub tseg, koj tuaj yeem thauj lawv yav tom ntej raws li kev npaj ua ntej kom yooj yim GPIO kev hloov kho!

Kauj Ruam 4: Ua Haujlwm BluChip

Programming lub BluChip
Programming lub BluChip
Programming BluChip
Programming BluChip
Programming BluChip
Programming BluChip

Koj yuav tau pom los ntawm cov vis dis aus saum toj no tias BluChip lub npe ntaus ntawv ntawm kuv lub xov tooj txawv ntawm koj li, yog li peb yuav hloov pauv li cas rau peb tus kheej nyiam?

Daim ntawv thov firmware khiav ntawm BluChip ua haujlwm li Peripheral device (qhev) hla BLE rau Central cov cuab yeej (tus tswv) xws li cov xov tooj txuas nrog nws. Txhawm rau hloov peb lub cuab yeej lub npe, cia peb khawb hauv qhov ua kom pom daim ntawv thov firmware mus rau peb BluChip.

Nrog rau cov khoom siv BluChip Explorer yog ARM Programmer (CMSIS-DAP). MakerChips tau muab txoj hauv kev Yuav Ua Li Cas-Qhia txog cov ntsiab lus ntawm flashing firmware mus rau BluChip nrog CMSIS-DAP.

Txhawm rau sau cov firmware rau hauv cov ntaub ntawv hex thiab nyem nws, peb yuav xav tau Keil, nRF51 Software Development Kit (SDK), thiab BluChip firmware. Mus tom ntej thiab rub tawm lawv los ntawm cov kab ntawv txuas hauv "Software" ntu ntawm MakerChips 'Programming BluChip nrog CMSIS-DAP thiab Keil nplooj ntawv.

Nruab Keil, tom qab ntawd ua raws cov theem 1-3 hauv ntu "Tsim Cov Ntaub Ntawv Hex".

Txij ntawm no mus, koj tuaj yeem txuas mus rau Kauj Ruam 4, Rov Tsim Kho Txhua Lub Hom Phiaj Cov Ntaub Ntawv.

Yog tias koj tau txais qhov yuam kev hais txog "core_cm0.h", koj yuav tsum tau ntxiv nws txoj hauv kev rau txoj haujlwm kom suav sau nws.

Peb tsuas yog yuav tsum tau tshawb nrhiav cov ntawv, thiab nrhiav nws phau ntawv teev npe, uas yog "\ components / toolchain / gcc".

Cia peb suav nrog txoj hauv kev no rau peb txoj haujlwm. Nyem Xaiv rau Lub Hom Phiaj, mus rau C/C ++ tab tom qab ntawd suav nrog txoj hauv kev raws li qhia hauv daim duab 16.

Tom qab suav nrog qhov tsim nyog tau txais kev tso cai, peb txoj haujlwm suav nrog thiab tam sim no peb tuaj yeem saib cov ntaub ntawv tso ua ke, cov ntawv hex ntawm nRF51_SDK_10.0.0_dc26b5e / piv txwv / ble_peripheral / ble_app_ahc-master / bluchip / s110_with_dfu / arm4 / _buildnrf51422_xxac_s110.

Txhawm rau nyem cov ntawv hex mus rau BluChip, ua raws cov kauj ruam 1-8 hauv ntu "Hloov Cov Ntaub Ntawv Hex".

Tam sim no koj tau rub lub khoos phis tawm mus rau BluChip nrog cov khoom siv tshwj xeeb lub npe, tua hluav taws nRF Txuas app thiab luam theej duab rau koj lub cuab yeej. Koj yuav pom tias tam sim no muaj npe tom qab qhov koj tau txhais hauv DEVICE_NAME hauv firmware!

Hauv cov kauj ruam tom ntej, peb yuav pib teeb tsa kho vajtse, khoom siv hluav taws xob & software ntawm peb Lub Tshuab Hluav Taws Xob Hauv Tsev.

Kauj Ruam 5: Txhim Kho Cov Kab Hlau Rhuav

Image
Image
Txhim Kho Cov Kab Hlau Rhuav
Txhim Kho Cov Kab Hlau Rhuav
Txhim Kho Cov Kab Hlau Rhuav
Txhim Kho Cov Kab Hlau Rhuav
Txhim Kho Cov Kab Hlau Tuaj
Txhim Kho Cov Kab Hlau Tuaj

Tom qab tau tshuaj xyuas cov txheej txheem ntawm kev suav sau thiab ua kom pom peb lub khoos phis tawj, cia peb txav mus los tsim peb tus kheej bluetooth kab hlau rhuav!

Lub tshuab hluav taws xob stepper yuav raug siv los tsav txoj siv sijhawm uas txav cov ntaub thaiv qhib thiab kaw. Stepper lub cev muaj zog tau tsav los ntawm Half-H tsav IC uas yuav tswj hwm los ntawm BluChip.

Rau lub zog, peb yuav siv 12V AC-DC tus tswj hluav taws xob uas tau pub rau lub cev muaj zog, ua ke nrog LM317 DC-DC tus tswj hluav taws xob kom nqis qis 12V mus rau 3.3V uas yuav ua rau lub BluChip thiab Stepper Tsav IC.

Koj tuaj yeem tau txais koj tus kheej heev BluChip module los ntawm MakerChips 'lub khw muag khoom tshiab ntawm Tindie, lossis los ntawm MakerChips Website.

Cia peb tau txais cov ntu hauv qab no ntxiv rau BluChip Explorer Cov Khoom Siv los pib sib dhos cov ntaub thaiv tsis siv neeg:

  • 12V 1A Hwj chim Adapter $ 3.40
  • Barrel Jack $ 0.68
  • LM317T Voltage Regulator $ 0.80
  • Resistors (200 & 330 Ohm) $ 1.69
  • L293D Stepper Driver $ 1.63
  • Unipolar Stepper Motor $ 8.00 (lossis $ 1.66 <= hloov kho qhov me me unipolar rau hauv bipolar stepper)
  • 6mm Sijhawm Siv $ 7.31
  • 6mm Iav $ 0.54 (lossis 3D luam tawm los ntawm Thingiverse)
  • 6mm Pulley $ 1.17 (lossis 3D luam tawm los ntawm Thingiverse)
  • Txwv Hloov x2 (xaiv tau) $ 1.34
  • Lub thawv kaw qhov project (xaiv tau) $ 1.06
  • Breadboard Jumper Wires $ 2.09
  • Dupont Jumper Wires $ 2.80
  • Roj Hmab Bands $ 1.13
  • Twist Ties $ 3.22
  • 22 AWG Hlau (xaiv tau) $ 1.22
  • Zip kev sib txuas (xaiv tau) $ 0.63
  • Ntsws lub raj (xaiv tau) $ 1.97

Cov cuab yeej (yeem):

  • Rab Phom Kub Kub $ 3.75
  • Cov Hlau Hlau $ 6.79

Rub tawm Cov Nqi Khoom ntawm GitHub (Amazon)

Daim duab 20 qhia txog yuav ua li cas koj yuav xaim lub kaw lus, nyob ntawm seb yam twg koj xaiv los ntxiv. Yog tias koj xav tau kev txav mus los ntau dua, koj yuav ntxiv qhov txwv txwv rau txoj haujlwm.

Txwv kev hloov pauv yog cov ntsiab lus kawg rau daim ntaub thaiv uas qhia rau BluChip thaum nws qhib lossis kaw. Yog tsis muaj qhov txwv Hloov, koj yuav tsum tau teeb tsa lub khoos phis tawj kom qhia tau tias nyob deb npaum li cas koj cov kab hlau rhuav nyob hauv ntu "Firmware Configuration" yuav los tom ntej.

Daim duab 20 kuj suav nrog kev xaiv tus yees duab tiv thaiv uas tso cai rau kev tshawb pom nruab hnub thiab hmo ntuj, tseem tuaj yeem teeb tsa hauv ntu "Firmware Configuration".

Pib qhov kev sib dhos ntawm cov cuab yeej tawm los ntawm kev nce lub stepper lub cev muaj zog, cov menyuam thiab lub sijhawm siv rau sab saum toj ntawm koj cov ntaub. (Daim duab 21)

Ib ntus nro siv sijhawm siv nrog cov hlua roj hmab. Tom qab ntawv, ua ntej ua tiav txoj haujlwm, koj yuav zip khi nws ua ke los tuav nws mus tas li.

Txhawm rau txuas cov ntaub thaiv rau koj txoj siv sijhawm, ntxig Cov hlua khi ib ncig ntawm txoj siv thiab kab hlau rhuav.

Txhawm rau kom tau txais lub tswv yim zoo ntawm yuav ua li cas txhawm rau khi cov kab hlau rau txoj siv, ua raws daim duab 22. Koj yuav tau khi txoj hlua kab laug sab rau tom qab ntawm txoj siv sijhawm nrog txoj hlua khi, thiab txoj kab hlau xis rau sab xub ntiag ntawm txoj siv sijhawm nrog txoj hlua khi.

Thaum koj tau txais txoj siv hlua khi thiab kab hlau rhuav, tshem tawm lub tshuab hluav taws xob kom peb tuaj yeem pib sib sau ua ke thiab ntsuas cov hluav taws xob hluav taws xob uas yuav tsav nws. rau daim duab 20.

Ntxig rau 200 & 330 ohm resistors raws li daim duab 20. Cov resistors hloov LM317 qhov tso tawm kom nws muab ~ 3.3V. (Daim duab 24)

Ntxig lub jumper xaim xaim xaim txuas txuas raws li qhia hauv daim duab 26.

Cia peb ntsaws rau hauv peb lub hwj huam hloov mus rau lub qhov (socket) phab ntsa, thiab ntsaws lub adapter rau hauv lub tog raj kheej txhawm rau ntsuas qhov ntsuas hluav taws xob raws li pom hauv daim duab 27.

Thaum qhov ntsuas hluav taws xob tau raug lees paub, tshem lub hwj chim tawm thiab pib tso cov khoom txuas txuas txuas txuas txuas ntxiv raws li daim duab 20.

Tom ntej no, peb tab tom yuav xaim peb lub bipolar stepper motor mus rau L293d IC.

Ua ntej, tso Dupont jumper xov hlau rau hauv stepper lub cev sib txuas raws li qhia hauv daim duab 29.

Txhawm rau paub cov xov hlau mus qhov twg, ua raws cov txheej txheem hauv daim duab 30.

Raws li pom hauv cov txheej txheem, cov coj los ntawm ib lub kauj mus rau Pin2 & Pin6 ntawm L293D. Cov hlau lead los ntawm lwm qhov txuas mus rau Pin11 & Pin14.

Hloov kho 28BYJ-48 bipolar stepper lub cev muaj plaub lub xov tooj uas siv tau zoo li pom hauv daim duab 31.

Peb xaim xiav rau Pin3, daj rau Pin6, txiv kab ntxwv rau Pin11 thiab liab rau Pin14 ntawm L293d.

Tam sim no cov xov tooj cua yooj yim tau ua tiav!

Yog tias koj xav siv txoj cai txwv, xaim NO & C coj mus rau qee qhov 22AWG xaim. Ntawm lwm qhov kawg, txuas DuPont cov neeg dhia kom tsim cov coj uas haum rau ntawm lub khob cij. (Daim duab 32)

Koj tuaj yeem rub lawv mus rau txoj kab tsheb nqaj hlau raws li qhia hauv daim duab 33 nrog cov hlua roj hmab, lossis yog tias koj muaj rab phom kub kub ntawm tes koj tuaj yeem zaws khi nws mus rau txoj kev tsheb ciav hlau tom qab ntawd muab cov kua nplaum kub kom zoo kom nws tsis txav mus. ib ncig

Txhawm rau kom tau txais lub tswv yim ntawm qhov chaw tso lawv, xa mus rau daim duab 34.

Ib txoj kev txwv txwv tau txuas mus rau qhov kawg-sab laug ntawm txoj kab tsheb nqaj hlau, nruab nrab ntawm txoj kev tsheb nqaj hlau thawj thiab ob, yog li thaum cov ntaub thaiv kab hlau qhib qhib sib ntsib nias rau ntawm qhov hloov thiab qhib nws. Lwm qhov kev txwv txwv tau muab tso ncaj qha rau ntawm qhov chaw ntawm txoj kev tsheb nqaj hlau, tig mus rau sab laug. Txoj kev no, nws tau qhib thaum cov ntaub thaiv kaw.

Ntxig qhov txwv txwv hloov mus rau lub khob cij raws li daim duab 20.

Thaum kawg, yog tias koj xav kom koj cov ntaub thaiv kom qhib thaum lub hnub nce thiab kaw thaum nws teeb tsa, koj yuav tsum tau xaim lub koob yees duab tiv thaiv raws li qhia hauv FIgure 36, thiab teeb nws ze rau qhov uas nws tau nkag mus rau tshav ntuj thaum kaj ntug.

Tom qab koj ua tiav nrog lub rooj sib tham ua mov ci teeb tsa, npaj tau thiab txuas koj tus programmer rau BluChip kom nyem lub firmware. Rub tawm lub firmware los ntawm GitHub thiab rho tawm nws mus rau hauv koj phau ntawv teev npe SDK zoo li koj tau ua dhau los.

Rub tawm ble_app_ahc.zip los ntawm Github.

Qhib qhov project, tom qab ntawv suav thiab xa cov firmware rau BluChip.

Ua ntej ntsuas nws tawm, peb yuav muab lub khob cij rau hauv ib lub thawv thiab ua qhov rau cov xov hlau thiab peb Cov Kab Hlau Kab Ke LED.

Muab lub khob cij tso rau ntawm lub hauv paus ntawm lub thawv ntawv thiab ua kom qhib rau cov xov hlau. Qhov qhib tseem ua lub ntsiab lus rau BluChip txhawm rau sib txuas lus rau lwm yam khoom siv los ntawm nws lub kav hlau txais xov. (Daim duab 37)

Laum ib lub qhov loj ntawm LED ntawm ib sab ntawm lub thawv ntawv thiab teeb lub LED rau nws. Hlau LED raws li daim duab 20.

Nrhiav qhov chaw tsim nyog txhawm rau txhawm rau txhawm rau lub thawv thaiv rau sab laug ntawm kab hlau rhuav kab hlau, ze rau lub qhov hluav taws xob. Tshem tawm lub tshuab thiab ua qhov ntsuas nruj kawg ntawm txoj siv sijhawm, ua kom ntseeg tau tias tsis muaj qhov poob qis. (Daim duab 39)

Tam sim no nws yog lub sijhawm los sim peb cov kab ke sib dhos. Ntxig lub hwj chim adapter thiab tua koj li nRF Txuas app. Koj yuav pom lub cuab yeej npe Curtains. BluChip.

Txuas rau nws, xa tus nqi ntawm UINT8 1 (Qhib kab hlau rhuav) mus rau qhov tsis paub yam ntxwv nyob hauv qhov kev pabcuam uas tsis paub, thiab saib cov ntaub thaiv qhib!

Tam sim no koj tau ua tiav kev sim koj lub kaw lus, cia saib xyuas kev teeb tsa qee cov cai uas tab tom ua yeeb yam ntawm BluChip.

Kauj ruam 6: BluChip Firmware Configuration

BluChip Firmware Configuration
BluChip Firmware Configuration
BluChip Firmware Configuration
BluChip Firmware Configuration
BluChip Firmware Configuration
BluChip Firmware Configuration

Qhov Automated Home Curtain firmware txoj haujlwm suav nrog feem ntau ntawm 4 cov ntaub ntawv: main.c, ahc.c, ble_ahc_service.c & ble_ahc_service.h.

Thaum tsim cov khoom siv hluav taws xob & kho vajtse, peb muaj qhov kev xaiv los xaiv yog tias peb xav txwv cov hloov pauv kom nce qhov tseeb ntawm peb qhov kev siv tshuab.

Hauv cov cai los ntawm ahc.h, peb tuaj yeem pom #define rau LIMIT_SWITCHES.

Ua ke thiab ua kom pom kev zoo nrog #define LIMIT_SWITCHES ua rau siv ob qho kev txwv hloov mus txhawm rau txheeb xyuas thaum cov ntaub thaiv tau qhib thiab kaw.

Hloov nws mus rau #undef LIMIT_SWITCHES xav tau yog tias koj xaiv tsis suav nrog qhov txwv txwv rau koj txoj haujlwm. Hauv qhov no, koj yuav tsum tau kho qhov kev ncua deb uas koj kab hlau rhuav mus rau qhov sib txawv CURTAIN_OPEN_STEPS thiab CURTAIN_CLOSE_STEPS. Kho cov txiaj ntsig no kom ntev dua lossis ua kom luv daim kab xev mus kev deb.

Lwm qhov kev xaiv, ntxiv photoresistor, tuaj yeem ua haujlwm los ntawm kev hloov kho #undef LDR rau #define LDR. LDR sawv rau Lub Teeb-nyob ntawm tus tiv thaiv, tseem hu ua photoresistor. Thaum peb pab LDR, tus kws yees duab paub thaum nws ci lossis tsaus ntuj sab nraum, thiab pab koj kaw lossis qhib koj daim ntaub thaiv thaum pib lossis xaus rau hnub ntawd.

Dhau li teeb tsa Lub Lim Hloov Hloov thiab Photoresistor, cia saib ntawm qee qhov ntawm lwm qhov tseem ceeb ntawm cov cai uas tso cai rau koj qhib thiab kaw cov ntaub.

Cov ntaub ntawv ble_ahc_service.c & ble_ahc_service.h muaj cov lej uas xa cov ntaub ntawv los ntawm koj lub xov tooj mus rau BluChip.

Thaum BluChip tau txais cov ntaub ntawv, nws cais nws raws li yog tias 0 lossis 1 tau xa. Tom qab ntawd nws qhib qhov xwm txheej LED, ua lub zog txav, thiab tom qab ntawd ua kom lub teeb liab LED tiav.

Kev ua haujlwm ahc_init () los ntawm ahc.h tau pib thaum pib ntawm lub voj loj, pib ua txhua tus pin ntawm BluChip.

Kauj Ruam 7: Cov ntsiab lus

Txhawm rau xaus, qhov no yog qhov haujlwm lom zem heev thiab yooj yim haum rau kom tau kawm BLE cov hauv paus. Qhov tseeb tias BluChip's breakout module haum snugly ntawm lub khob cij ua rau nws yooj yim tiag tiag rau tus qauv sai sai ntawm txhua lub khob cij uas koj tuaj yeem tso ib puag ncig.

Kuv yuav hais tias tom qab tsim kuv cov kab hlau rhuav tsis siv neeg, Kuv twb tau xav txog ntau yam ntxiv los nqes BluChip nrog, suav nrog cov ntse neopixels, OLED los tsim lub moos saib, lub xov tooj smartphone tswj, thiab ntau lwm yam hluav taws xob uas tsis muaj zog. cov tswv yim uas yuav xav tau kev sib txuas lus sib txuas wireless!

Ib tus neeg uas muaj kev txaus siab rau kev siv hluav taws xob thiab cov phiaj xwm yuav zoo siab heev txog qhov BluChip yuav tsum muaj, ntxiv rau kev yooj yim ntawm kev teeb tsa thiab siv BLE los hloov cov phiaj xwm mus rau qhov txias dua.

Raws li tam sim no, Kuv yuav tau rov qab los txaus siab rau kuv qhov yooj yim siv lub tsev kab hlau rhuav..

Pom zoo: