Cov txheej txheem:
Video: Tseeb Binary Moos Nrog NTP Sync: 4 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:24
Ib lub moos binary tseeb qhia lub sijhawm ntawm ib hnub raws li qhov sib npaug ntawm binary feem ntawm ib hnub, tsis zoo li ib txwm "binary moos" uas qhia sijhawm raws li binary-encoded decimal digits sib npaug rau teev/feeb/vib nas this. Tsoos "binary moos" yeej siv binary-encoded-decimal-encoded-sexagesimal. Dab tsi tsis meej pem! Qhov tseeb binary moos ua kom yooj yim rau ntau yam.
Hauv lub moos binary tseeb, thawj tus lej qhia koj yog ib nrab hnub, tus lej thib ob yog lub hlis thib peb, tus lej thib peb yog yim ntawm ib hnub, thiab lwm yam. Nws tuaj yeem nyeem rau txhua qhov kev daws teeb meem sai (nrog kev xyaum). Thawj tus lej suav tau zoo suav nrog AM piv rau PM, tus lej thib ob nkag siab tias nws yog ntxov AM/PM lossis lig AM/PM lig, thiab ntxiv rau.
Hauv kev tsim kuv lub sijhawm tiag tiag binary, kuv siv kaum ob tus lej ntawm kev daws teeb meem, yog li hnub tau muab faib ua 2^12 = 4096 ntu (txhua qhov nce yog kwv yees li 20 vib nas this). Tsis txhob khaws txhua tus lej hauv kab, 12 tus lej tau muab cais ua 3 kab ntawm 4 tus lej. Txawm hais tias tus lej binary tiag tiag tsis hloov pauv, qhov no tso cai rau lub moos nyeem raws li 3 tus lej binary-encoded hex tus lej, thawj kab uas qhia txog 16 ntawm ib hnub (1.5hrs), kab thib ob qhia 256ths ntawm ib hnub (~ 5 feeb), thiab kab thib peb qhia 4096ths ntawm ib hnub (~ 20seconds).
Lub moos tau ua tiav rau NTP (Network Time Protocol) siv ESP8266. ESP8266 tau teeb tsa kom yog li, thaum pib, nias lub pob ntawm lub moos yuav xa nws mus rau qhov chaw teeb tsa. Hauv cov chaw teeb tsa, lub moos yuav tsim WiFi network uas ua haujlwm rau lub vev xaib uas tuaj yeem siv nkag mus rau koj tus kheej teeb tsa wifi, NTP server, thiab sijhawm sijhawm. Cov ntaub ntawv no tau khaws cia hauv EEPROM ntawm ESP8266 thiab tau nyeem thaum lub moos pib hauv lub moos hom yog li nws tuaj yeem txuas rau internet thiab khaws lub sijhawm.
Khoom siv:
- NodeMCU ESP8266
- WS2812B LED sawb
- Pushbutton
- 470 Ohm tus tiv thaiv
- 10K Ohm resistor
- 470 uF capacitor
- Popsicle sticks
- Marbles
- Ntoo (lossis lwm daim ntawv ntawm cov khoom) rau rooj plaub
Kauj ruam 1: Circuit Court
Txhawm rau kom muaj cov zaub, txoj haujlwm no siv RGB coj kab txaij tso rau hauv 3 kab. Kuv txiav 3 kab ntawm 8 leds los ntawm kab txaij ntawm WS2812B leds thiab muab lawv ua ke. (Lawv tsis yooj yim thiab siv cov pawm me me tuaj yeem nyuaj. Kuv qhwv cov hlua txuas hauv kab xev hluav taws xob txhawm rau txhawm rau tiv thaiv lawv los ntawm kev khoov.) Txawm hais tias kuv tsuas xav tau 4 leds ib kab, Kuv txiav tawm ib daim hlab ntawm 8 kom kuv tuaj yeem muaj qhov sib nrug ntau dua ntawm lub teeb los ntawm kev siv txhua lwm coj. Cov kab no tau raug daig rau hauv lub hauv paus uas ua los ntawm cov popsicle sticks. Hauv nruab nrab ntawm txhua kab, ob txheej txheej ntawm popsicle sticks muab cov ntaub ntawv kom lub ntsej muag pem hauv ntej tuaj yeem tiv thaiv sab hauv ntawm rooj plaub ntawm lub moos (saib duab).
Cov hlua coj tau siv los ntawm VU thiab GND ntawm NodeMCU. VU yog lub zog los (yuav luag) ncaj qha los ntawm USB, yog li nws muab 5V rau WS2812B LEDs txawm hais tias ESP8266 ua haujlwm ntawm 3.3V. Kuv tso 470 uF capacitor hla lub zog rau WS2812B sawb los tiv thaiv cov coj. Cov ntaub ntawv rau cov hlua coj tau txuas nrog D3 tus pin ntawm NodeMCU ntawm 470 Ohm resistor. Xa mus rau cov lus qhia no kom paub ntau ntxiv txog yuav ua li cas tswj WS2812B leds nrog ESP8266. Lub voj voog tau muab muag rau ntawm daim phiaj-nrog qee tus txiv neej-rau-poj niam lub taub hau rau NodeMCU.
Lub laub khawm tseem tau txuas rau D6 ntawm NodeMCU. Lub pob nyem no tuaj yeem nias thaum lub moos tab tom pib xa nws mus rau qhov chaw teeb tsa (hauv qhov chaw teeb tsa wifi, NTP neeg rau zaub mov, thiab lub sijhawm nyiam tuaj yeem hloov kho). Ntawm ib qho kawg lub laub khawm txuas nrog D6 thiab tseem rau GND ntawm 10K Ohm resistor thiab ntawm qhov kawg nws txuas nrog lub zog. Thaum lub pob tsis muaj zog, D6 nyeem qis; thaum nws nias, D6 nyeem siab.
Kauj ruam 2: Software
Lub software rau ESP8266 tau sau siv Arduino code. Cov LEDs tau ua haujlwm siv lub tsev qiv ntawv FastLED thiab NTP sib txuas ua tiav los ntawm NTPClient lub tsev qiv ntawv. Lub sijhawm sib txuas los ntawm NTP txhua teev.
Thaum pib ua haujlwm teeb tsa, qhov kev zov me nyuam tshuaj xyuas seb lub pob txuas nrog D6 raug nias. Yog tias nws yog, ESP8266 tsim lub network wifi (SSID thiab password tuaj yeem hloov pauv hauv tus lej, lub hauv paus SSID yog "TrueBinary" thiab tus password yog "thepoweroftwo"). Txuas rau lub network no los ntawm ib lub cuab yeej twg thiab mus rau 192.168.1.1. ESP8266 yuav ua haujlwm rau lub vev xaib nrog cov ntawv uas koj tuaj yeem nkag mus rau koj tus lej wifi SSID thiab tus password, nyiam NTP server, thiab lub sijhawm nyob ntawm UTC. Tom qab cov ntawv no xa mus rau ESP8266, nws yuav khaws cov ntaub ntawv mus rau nws sab hauv EEPROM cia.
Yog tias lub pob tsis raug nias, lub moos pib ua haujlwm ib txwm, nyeem cov teeb tsa los ntawm EEPROM, txuas rau wifi siv NTP, thiab pib tso saib lub sijhawm.
NCO TSEG: kev ua haujlwm setDisplay (int index) siv tus lej tus lej los ntawm 0-11 qhov 0 yog thawj tus lej (ib nrab hnub) thiab 11 yog qhov kawg (1/4096 ntawm ib hnub) thiab tig rau qhov sib txuas LED siv " leds "array. Txoj haujlwm no yuav tsum tau ua kom tiav raws li qhov koj teeb tsa cov zaub. Kuv tau hais tawm qhov piv txwv sib xws li cas kuv tau muab cov kab ua zig-zag zam ntau dua li qhov kawg-rau-kawg thiab hla txhua lwm qhov LED.
Kauj Ruam 3: Vaj Tsev
Los tsev lub moos, Kuv siv lub kaum xim ntoo uas kuv tau tshwm sim muaj. Ntawm ib lub ntsej muag sab nrauv, Kuv tau hlais 12 qhov hauv kab sib chaws sib luag rau txoj haujlwm ntawm LEDs. Tom qab ntawd kuv tau teeb lub LEDs rau sab hauv ntawm lub kaum sab xis los ntawm gluing lub ntsej muag tsa ntawm cov popsicle sticks hauv-nruab nrab kab mus rau ntoo (raws li qhia). Txhawm rau nthuav lub teeb los ntawm LEDs, Kuv daig iav pob zeb saum toj ntawm lub qhov. Kuv ua tiav qhov no los ntawm kev nqes hauv qab ib nrab ntawm txhua pob zeb hauv epoxy cob thiab tom qab ntawd muab lawv tso rau hauv qhov. NodeMCU thiab pawg thawj coj tau raug ntsia mus rau lwm sab hauv lub ntsej muag ntawm lub kaum ntse ntse. Ob sab tau npog siv cov voos me me ntawm cov ntoo, txuas nrog cov kua nplaum ntoo. Ib ntawm ob sab muaj lub qhov rau micro USB chaw nres nkoj ntawm NodeMCU thiab txiav hauv lub ces kaum rau lub laub khawm.
Kauj ruam 4: Ua tiav
Peb qhov tseeb binary moos tau ua tiav! Txhawm rau teeb tsa nws, khaws lub pob nyem thaum ntsaws nws rau hauv nws kom teeb tsa hom thiab tom qab ntawd nkag mus rau WiFi daim ntawv pov thawj ntawm nws lub vev xaib. Thaum teeb tsa, lub moos tuaj yeem txuas rau txhua qhov chaw thiab yuav cia li txuas rau hauv is taws nem thiab pib tso saib lub sijhawm hauv binary.
Nws siv sijhawm ntawm kev xyaum los nyeem lub sijhawm hauv hom binary tseeb, tab sis nws yog kev tawm dag zog lom zem thiab tom qab ib pliag nws dhau los ua txoj hauv kev nrawm kom tau txais lub sijhawm nrog tsuas yog saib ib muag!
Pom zoo:
QHOV QHOV TSEEB QHOV TSEEB QHOV TSEEB TSHIAB (Pi Tsev Ruaj Ntseg): 7 Kauj Ruam
LOST COST IOT THEFT DETECTION DEVICE (Pi Home Security): Lub kaw lus tau tsim los txhawm rau txheeb xyuas kev nkag mus (tsis tau tso cai nkag mus) rau hauv lub tsev lossis lwm thaj chaw. Txoj haujlwm no tuaj yeem siv hauv thaj chaw nyob, kev lag luam, kev lag luam, thiab cov tub rog lub zog rau kev tiv thaiv kev nyiag khoom lossis khoom puas tsuaj, ib yam
Kev Txawj Ntse Alexa: Nyeem Qhov Tseeb Tseeb Tseeb (Hauv Qhov No, Vajtswv): 6 Kauj Ruam
Alexa Skill: Nyeem Qhov Tseeb Tseeb (Hauv Qhov No, Vajtswv): Kuv tau ua Alexa Skill los nyeem " Vajtswv Tseeb Tweet " - cov ntsiab lus, uas yog, los ntawm @TweetOfGod, 5 lab+ tus lej sau npe tus account tsim los ntawm yav dhau los Txhua Hnub Qhia Ua Yeeb Yaj Kiab. Nws siv IFTTT (Yog Qhov No Yog Li No), Google Daim Ntawv Qhia Tawm, thiab
Hack Canon EOS 300D kom paub tseeb tias ua kom pom tseeb nrog txhua lo ntsiab muag, tas mus li.: 5 Kauj Ruam (nrog Duab)
Hack Canon EOS 300D kom Pom Zoo Nrog Txhua Lub Luag Haujlwm, Mus tas li.: Zoo, yog, koj tuaj yeem ua qhov no yooj yim los ntawm kev siv ntau yam chipped adapters rau ntau lub lens teeb tsa - tab sis yuav ua li cas thiaj li hloov kho koj lub koob yees duab kom zoo ib yam thiab zam kev them nyiaj ntxiv rau ntau yam adapters? Kuv nyiam kuv 300D tab sis kuv tsis muaj lub lens EF/S
Sib Sau Cov Pob Zeb Tseeb Tseeb tiag (RBBB) Arduino Clone - Hloov kho: 16 Cov Kauj Ruam
Sib Sau Cov Pob Zeb Tseeb Tseeb tiag (RBBB) Arduino Clone - Hloov tshiab: Hloov tshiab 8/16/2008: ntxiv cov duab ntawm pawg thawj coj sib txawv teeb tsa hauv qib kawg. Yog tias koj muaj qhov haujlwm Arduino xav tau tus hneev taw me me lossis cov khoom siv pheej yig rau siab, qhov no
Yuav Ua Li Cas Tsim Ib Qhov Tseeb Tseeb Duab Los Ntawm Ntau Qhov Tseeb Tseeb: 4 Cov Kauj Ruam
Yuav Ua Li Cas Tsim Ib Qhov Ua Kom Pom Dua Duab Los Ntawm Ntau Qhov Ua Ntej Ua Ntej: Kuv qhia kom siv Helicon Focus software. Windows thiab Mac version muaj nyob ntawm d-Stidio qhov chaw Cov program tau tsim los rau kev siv duab thaij duab, microphotography thiab duab toj roob hauv pes hyperfocal kom daws tau qhov teeb meem qhov tob ntawm qhov chaw.Hel