Cov txheej txheem:

Cascade of Shift Sau Npe 74HC595 Tswj Ntawm Arduino thiab Ethernet: 3 Kauj Ruam
Cascade of Shift Sau Npe 74HC595 Tswj Ntawm Arduino thiab Ethernet: 3 Kauj Ruam

Video: Cascade of Shift Sau Npe 74HC595 Tswj Ntawm Arduino thiab Ethernet: 3 Kauj Ruam

Video: Cascade of Shift Sau Npe 74HC595 Tswj Ntawm Arduino thiab Ethernet: 3 Kauj Ruam
Video: 10 самых АТМОСФЕРНЫХ мест Дагестана. БОЛЬШОЙ ВЫПУСК #Дагестан #ПутешествиеПоДагестану 2024, Kaum ib hlis
Anonim
Cascade of Shift Sau Npe 74HC595 Tswj ntawm Arduino thiab Ethernet
Cascade of Shift Sau Npe 74HC595 Tswj ntawm Arduino thiab Ethernet

Hnub no kuv xav nthuav qhia qhov haujlwm uas kuv tau ua tiav hauv ob qho. Txoj haujlwm siv 12 daim ntawv hloov npe 74HC595 thiab 96 LEDs, Arduino Uno board nrog Ethernet daim thaiv Wiznet W5100. 8 LEDs txuas nrog rau txhua qhov kev hloov npe. Cov lej 0-9 yog sawv cev los ntawm LEDs. Txhua qhov kev hloov pauv rau npe yog nruab nrog 8 lub davhlau ya nyob twg.

Txhua ntawm 4 qhov kev hloov pauv sau npe 74HC595 tsim cov chav ua haujlwm muaj kuab - cov zaub rau teev 4 tus lej. Nyob rau hauv tag nrho, muaj 3 cov lus qhia muaj tswv yim hauv qhov haujlwm suav nrog 12 hloov npe rau npe.

Kev siv ua tau zoo rau Arduino cov laug cam Nano, Mega, Uno thiab rau Ethernet cov ntaub thaiv thiab cov qauv los ntawm Wiznet tsev neeg, tshwj xeeb ua qauv W5100 thiab W5500 (siv Ethernet2 lub tsev qiv ntawv).

Khoom siv

  • Arduino Uno / Nano
  • Ethernet Wiznet W5100 / W5500
  • 4 txog 12 hloov npe sau npe 74HC595
  • 32 txog 96 LED diodes

Kauj Ruam 1: Txhim Kho Kev Txhim Kho hauv Txoj Haujlwm Nrog Arduino:

  • Webserver - HTTP server khiav ncaj qha rau Arduino, tso cai txhais HTML code
  • WebClient - Cov neeg siv khoom muaj peev xwm ua HTTP thov mus rau cov neeg rau zaub mov nyob deb, xa / rub tawm cov ntaub ntawv

Lub vev xaib

  • Muab lub vev xaib HTML nrog rau daim ntawv uas tso cai rau koj nkag mus rau 3 plaub-tus lej.
  • Tom qab xa daim ntawv, cov ntaub ntawv tau ua tiav thiab khaws cia hauv EEPROM nco, tus neeg siv tau ceeb toom txog kev ua cov ntaub ntawv los ntawm ib nplooj ntawv cais.
  • Tom qab khaws cov ntaub ntawv, tus neeg siv tau xa rov qab mus rau daim ntawv.
  • EEPROM nco yog lub zog ywj pheej, cov ntaub ntawv siv tau txawm tias tom qab lub zog rov zoo, tab sis kuj tseem rov pib dua.
  • Txhua tus lej tom qab ntawd sawv cev ntawm peb cov lus suav nrog 12 74HC595 hloov npe rau npe.

WebClient:

  • Kev sib txuas lus nrog lub vev xaib siv txhua 5 vib nas this tom qab HTTP raws tu qauv.
  • Lub web server khiav PHP daim ntawv thov lub vev xaib uas tso cai rau koj nkag mus rau 3 plaub tus lej ntawm daim ntawv HTML.
  • Cov ntaub ntawv los ntawm daim ntawv yog khaws cia hauv MySQL database.
  • Arduino thov kom khaws cov ntaub ntawv los ntawm cov ntaub ntawv no los ntawm kev nug mus rau server.
  • Cov ntaub ntawv ua tiav tau txheeb xyuas los ntawm Arduino, tom qab ntawv tau npaj siv kev hloov pauv npe 74HC595.
  • Cov ntaub ntawv kuj tseem khaws cia hauv EEPROM nco ntawm Arduino, lawv tau siv thaum qhov kev txuas mus rau lub vev xaib tsis ua haujlwm / thaum Arduino cov laug cam tau rov pib dua, lawv tau siv rau qhov pib ua cov ntaub ntawv ntawm kev hloov pauv npe.
  • Cov ntaub ntawv tau rov sau dua hauv EEPROM tsuas yog thaum cov ntaub ntawv hloov pauv, EEPROM cov cell raug cawm los ntawm kev sau tsis tseem ceeb.

Kauj ruam 2: thaiv & Screenshot

Teeb & Screenshot
Teeb & Screenshot
Teeb & Screenshot
Teeb & Screenshot

Cascade kev sib txuas rau kev hloov npe 74HC595 (tuaj yeem txuas ntxiv los ntawm x ntxiv) - Export los ntawm TinkerCAD. Screenshot nyob ntawd los ntawm webserver interface, thaum nws tau txais cov ntaub ntawv ntawm HTML daim ntawv, txheej txheem lawv, thiab khaws cia rau EEPROM nco.

Kauj Ruam 3: 74HC595 + Cov Cai Codes

Nws yog qhov tseeb los ntawm daim duab uas tsuas yog 3 cov ntaub ntawv xov hlau tau siv los tswj kev hloov pauv npe:

  • Cov Ntaub Ntawv Tawm - (SER rau 74HC595)
  • Lub moos tso tawm - (SRCLK ntawm 74HC595)
  • Latch Outlet - (RCLK rau 74HC595)

Cov ntawv teev npe hloov pauv tuaj yeem ua ke hauv qhov cascade, thaum lwm qhov khoom siv sab hauv kuj tseem tuaj yeem tswj tau los ntawm kev hloov pauv cov npe - piv txwv li, kev xa mus rau kev hloov pauv lub zog. Nws kuj tseem tuaj yeem tswj tau 500 cais kev xa tawm (nrog cov lej txaus ntawm cov npe hloov pauv thiab cov khoom siv hluav taws xob) nrog ib cov ntaub ntawv tso tawm.

Thaum tswj cov txiaj ntsig ntawm cov ntawv sau npe, nws tseem tuaj yeem hloov kho qhov byte xaj mus rau qhov tseem ceeb tshaj plaws - MSB FIRST, lossis rau LSB - qhov tsawg tshaj plaws. Raws li qhov tshwm sim, nws inverts cov txiaj ntsig. Hauv ib kis, piv txwv li, 7 diodes tau teeb, lwm qhov yog 1 diode nyob ntawm qhov kev nkag thiab byte xaj.

Ob qho kev siv EEPROM nco, uas tuaj yeem khaws cov ntaub ntawv txawm tias tom qab lub zog tsis ua haujlwm lossis tom qab rov pib dua lub rooj tsavxwm. Qhov kev siv thib ob ntawm lub cim xeeb no tseem yog lub peev xwm los sawv cev rau cov ntaub ntawv paub zaum kawg yog tias nws tsis muaj peev xwm sib txuas lus nrog lub web server (txuas yuam kev, server).

Nco tau txwv rau 10, 000 txog 100, 000 daim ntawv sau tseg. Kev tsim kho yog tsim los rau qhov nco tau tsawg kawg nkaus. Cov ntaub ntawv yuav tsis raug sau dua thaum lawv hloov pauv. Yog tias tib cov ntaub ntawv tau nyeem los ntawm lub web server / tus thov kev pabcuam, lawv tsis raug sau dua hauv EEPROM nco.

Kev siv software (Sab Arduino) rau WebClient tuaj yeem sim dawb ntawm:

Arduino sib txuas lus nrog lub vev xaib uas nws tuaj yeem hloov kho 3 tus lej plaub tus lej:

Nug kom muaj tus lej rau Arduino ua tus vev xaib ntawm: [email protected] Pab nyiaj pub dawb rau qhia ntxiv:

Pom zoo: