Cov txheej txheem:
- Kauj Ruam 1: Cov ntaub ntawv twg tuaj yeem khaws cia?
- Kauj ruam 2:
- Kauj ruam 3:
- Kauj ruam 4:
- Kauj ruam 5:
- Kauj Ruam 6:
Video: Koj Arduino's Inbuilt EEPROM: 6 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Hauv kab lus no peb yuav tshuaj xyuas sab hauv EEPROM hauv peb Arduino cov laug cam. Dab tsi yog EEPROM qee tus ntawm koj yuav hais? EEPROM yog Electrically Erasable Programmable Read-Only Memory.
Nws yog daim ntawv uas tsis hloov pauv lub cim xeeb uas tuaj yeem nco tau yam nrog lub zog raug kaw, lossis tom qab rov pib dua Arduino. Qhov zoo nkauj ntawm qhov cim xeeb no yog tias peb tuaj yeem khaws cov ntaub ntawv tsim tawm hauv daim duab kos ntawm qhov chaw ruaj khov dua.
Vim li cas koj thiaj siv EEPROM sab hauv? Rau cov xwm txheej uas cov ntaub ntawv tshwj xeeb rau qhov xwm txheej xav tau lub tsev nyob tas mus li. Piv txwv li, khaws cia tus lej tshwj xeeb thiab hnub tsim khoom ntawm kev lag luam Arduino-raws txoj haujlwm-kev ua haujlwm ntawm cov duab kos tuaj yeem tso tawm tus lej xov tooj ntawm LCD, lossis cov ntaub ntawv tuaj yeem nyeem los ntawm kev xa tawm 'kev pabcuam kos duab'. Lossis koj yuav xav suav qee qhov xwm txheej thiab tsis tso cai rau tus neeg siv rov kho lawv-xws li lub ntsuas cua lossis ntsuas lub voj voog ua haujlwm.
Kauj Ruam 1: Cov ntaub ntawv twg tuaj yeem khaws cia?
Txhua yam uas tuaj yeem sawv cev ua bytes ntawm cov ntaub ntawv. Ib byte ntawm cov ntaub ntawv yog ua los ntawm yim khoom ntawm cov ntaub ntawv. Me ntsis tuaj yeem yog (tus nqi 1) lossis tawm (tus nqi 0), thiab zoo meej rau sawv cev rau tus lej hauv daim ntawv binary. Hauv lwm lo lus, tus lej binary tuaj yeem siv zeros thiab tus lej los sawv cev rau tus nqi. Yog li binary tseem hu ua "base-2", vim nws tsuas tuaj yeem siv ob tus lej.
Yuav ua li cas tus lej binary nrog tsuas yog siv ob tus lej sawv cev rau tus lej loj? Nws siv ntau yam thiab xoom. Cia peb tshuaj xyuas tus lej binary, hais 10101010. Raws li qhov no yog tus lej-2 tus lej, txhua tus lej sawv cev 2 rau lub zog x, los ntawm x = 0 mus rau tom ntej.
Kauj ruam 2:
Saib seb txhua tus lej ntawm tus lej binary tuaj yeem sawv cev rau tus lej-10 tus lej. Yog li tus lej binary saum toj no sawv cev rau 85 hauv paus-10-tus nqi 85 yog qhov sib npaug ntawm cov hauv paus-10 qhov tseem ceeb. Lwm qhov piv txwv - 11111111 hauv binary sib npaug 255 hauv lub hauv paus 10.
Kauj ruam 3:
Tam sim no txhua tus lej hauv tus lej binary siv ib qho 'me ntsis' ntawm kev nco, thiab yim khoom ua ib byte. Vim yog kev txwv sab hauv ntawm microcontrollers hauv peb Arduino cov laug cam, peb tsuas tuaj yeem khaws 8-tus lej (ib byte) hauv EEPROM.
Qhov no txwv tus lej zauv ntawm tus lej kom poob ntawm xoom thiab 255. Nws yog tom qab koj txiav txim siab li cas koj cov ntaub ntawv tuaj yeem sawv cev nrog tus lej ntawd. Tsis txhob cia qhov ntawd tso koj tawm - cov lej nyob hauv txoj kev raug tuaj yeem sawv cev yuav luag txhua yam! Muaj ib qho kev txwv kom ceev faj - pes tsawg lub sijhawm peb tuaj yeem nyeem lossis sau ntawv mus rau EEPROM. Raws li cov chaw tsim khoom Atmel, EEPROM zoo rau 100, 000 nyeem/sau mus (saib cov ntaub ntawv).
Kauj ruam 4:
Tam sim no peb paub peb cov khoom thiab bytes, pes tsawg bytes tuaj yeem khaws hauv peb Arduino lub microcontroller? Cov lus teb sib txawv nyob ntawm tus qauv ntawm microcontroller. Piv txwv li:
- Cov laug cam nrog Atmel ATmega328, xws li Arduino Uno, Uno SMD, Nano, Lilypad, thiab lwm yam - 1024 bytes (1 kilobyte)
- Cov laug cam nrog Atmel ATmega1280 lossis 2560, xws li Arduino Mega series - 4096 bytes (4 kilobytes)
- Cov laug cam nrog Atmel ATmega168, xws li thawj Arduino Lilypad, qub Nano, Diecimila thiab lwm yam - 512 bytes.
Yog tias koj tsis paub meej saib ntawm Arduino kho vajtse ntsuas lossis nug koj tus thawj coj khoom lag luam. Yog tias koj xav tau EEPROM ntau dua li qhov muaj nrog koj lub microcontroller, txiav txim siab siv I2C EEPROM sab nraud.
Txog tam sim no peb tam sim no nkag siab txog cov ntaub ntawv twg thiab ntau npaum li cas tuaj yeem khaws cia hauv peb Arduino's EEPROM. Tam sim no nws yog lub sijhawm los ua qhov no. Raws li tau tham ua ntej, muaj qhov txwv qhov chaw rau peb cov ntaub ntawv. Hauv cov piv txwv hauv qab no, peb yuav siv lub rooj sib tham Arduino nrog ATmega328 nrog 1024 bytes ntawm EEPROM cia.
Kauj ruam 5:
Txhawm rau siv EEPROM, yuav tsum muaj lub tsev qiv ntawv, yog li siv cov tsev qiv ntawv hauv qab no hauv koj cov duab kos:
#suav nrog "EEPROM.h"
Tus so yog yooj yim heev. Txhawm rau khaws ib qho ntawm cov ntaub ntawv, peb siv cov haujlwm hauv qab no:
EEPROM.write (a, b);
Qhov ntsuas a yog txoj haujlwm hauv EEPROM khaws cov lej (0 ~ 255) ntawm cov ntaub ntawv b. Hauv qhov piv txwv no, peb muaj 1024 bytes ntawm lub cim xeeb cia, yog li tus nqi ntawm a yog nruab nrab ntawm 0 thiab 1023. Txhawm rau khaws ib daim ntawm cov ntaub ntawv zoo ib yam li yooj yim, siv:
z = EEPROM.read (a);
Qhov twg z yog tus lej txhawm rau khaws cov ntaub ntawv los ntawm EEPROM txoj haujlwm a. Tam sim no kom pom ib qho piv txwv.
Kauj Ruam 6:
Cov duab kos no yuav tsim cov lej sib xws ntawm 0 thiab 255, khaws cia rau hauv EEPROM, tom qab ntawd rov qab los thiab muab tso rau ntawm cov ntawv saib. Qhov sib txawv EEsize yog qhov txwv qis tshaj ntawm koj li EEPROM loj, yog li (piv txwv) qhov no yuav yog 1024 rau Arduino Uno, lossis 4096 rau Mega.
// Arduino sab hauv EEPROM ua qauv qhia
#suav nrog
zz koj;. int EEsize = 1024; // loj hauv bytes ntawm koj lub rooj tsav xwm EEPROM
void teeb tsa ()
{Serial.begin (9600); randomSeed (analogRead (0)); } void loop () {Serial.println ("Sau cov lej tsis raug …"); rau (int i = 0; i <EEsize; i ++) {zz = random (255); EEPROM.write (i, zz); } Serial.println (); rau (int a = 0; a <EEsize; a ++) {zz = EEPROM.read (a); Serial.print ("EEPROM txoj haujlwm:"); Serial.print (a); Serial.print ("muaj"); Serial.println (zz); ncua (25); }}
Cov zis los ntawm cov saib saib yuav tshwm, raws li qhia hauv daim duab.
Yog li ntawd koj muaj nws, lwm txoj hauv kev zoo los khaws cov ntaub ntawv nrog peb cov tshuab Arduino. Txawm hais tias tsis yog qhov qhia tau zoo tshaj plaws, nws yeej yog qhov muaj txiaj ntsig.
Cov ntawv tshaj tawm no tau coj tuaj rau koj los ntawm pmdway.com - txhua yam rau cov kws tsim khoom thiab cov khoom siv hluav taws xob, nrog kev xa khoom dawb thoob ntiaj teb.
Pom zoo:
ESP32 Bluetooth Tutorial - Yuav Siv Li Cas Inbuilt Bluetooth ntawm ESP32: 5 Cov Kauj Ruam
ESP32 Bluetooth Tutorial | Yuav Siv Li Cas Inbuilt Bluetooth ntawm ESP32: Nyob zoo cov phooj ywg Txij li thaum ESP32 Board los nrog WiFi & Bluetooth ob leeg tab sis rau peb Cov Haujlwm Feem ntau peb feem ntau siv tsuas yog Wifi, peb tsis siv Bluetooth.Yog li hauv cov lus qhia no kuv yuav qhia yooj yim npaum li cas siv Bluetooth ntawm ESP32 & Rau koj qhov Projects yooj yim
Puas yog MakerBit tuaj yeem ceeb toom koj kom Txheeb Dej Hauv Koj Cov Ntoo Christmas?: 7 Cov kauj ruam
Puas yog MakerBit tuaj yeem ceeb toom koj kom Txheeb Dej Hauv Koj Cov Ntoo Christmas?: Tsob ntoo tshiab txiav yog ib qho kev ua tshoob zoo nkauj nyob rau ntau lub tsev. Nws yog ib qho tseem ceeb uas yuav tsum tau muab nws nrog dej tshiab. Puas yog nws zoo nkauj kom muaj cov khoom dai uas tuaj yeem pab qhia koj kom tshuaj xyuas cov dej hauv qab koj tsob ntoo? Qhov project no yog ib feem ntawm
Yuav Ua Li Cas Tau Txais Cov Nkauj Los Ntawm Txhua Qhov (Haha) Lub Vev Xaib (Ntev Li Koj Tau hnov Nws Koj Yuav Tau Txais Nws Ok Zoo Yog Nws Tau Ntxig Hauv Flash Koj Yuav Tsis Muaj Peev Xwm) EDITED !!!!! Ntxiv Info: 4 Cov Kauj Ruam
Yuav Ua Li Cas Tau Txais Cov Nkauj Los Ntawm Txhua Qhov (Haha) Lub Vev Xaib (Ntev Li Koj Tau hnov Nws Koj Yuav Tau Txais Nws … Ok Zoo Yog Nws Tau Ntxig Hauv Flash Koj Yuav Tsis Muaj Peev Xwm) EDITED !!!!! Ntxiv Cov Lus Qhia: yog tias koj tau mus rau lub vev xaib thiab nws ua nkauj nkauj uas koj nyiam thiab xav tau nws ntawm no yog cov lus qhia rau koj tsis yog kuv qhov txhaum yog tias koj cuam tshuam qee yam (tsuas yog txoj hauv kev nws yuav tshwm sim yog tias koj pib tshem cov khoom yam tsis muaj laj thawj. ) Kuv tuaj yeem tau txais cov nkauj rau
Yuav Ua Li Cas Txhim Kho Cov Ntaub Ntawv Tsis Txaus Siab, thiab Rub Tawm Koj Cov Video Video Nyiam Rau Koj Lub PSP Portable: 7 Cov Kauj Ruam
Yuav Ua Li Cas Txhim Kho Cov Ntaub Ntawv Tsis Txaus Siab, thiab Rub Tawm Koj Cov Video Video Nyiam Rau Koj Lub PSP Portable: Kuv siv Media Go, thiab tau ua qee qhov kev dag kom tau txais cov vis dis aus tsis txhawb nqa los ua haujlwm ntawm kuv PSP Qhov no yog txhua yam kuv cov kauj ruam uas kuv tau ua , thaum kuv xub tau txais kuv cov vis dis aus tsis txhawb nqa los ua haujlwm ntawm kuv PSP. Nws ua haujlwm 100% nrog tag nrho kuv cov vis dis aus rau kuv PSP Po
Hack Koj Tus Neeg Sawv Cev V1.00 - Tig Koj Cov Servo Rau Hauv Cov Hwj Huam Tawm Tawm: 7 Cov Kauj Ruam
Hack Koj Tus Neeg Sawv Cev V1.00 - Tig Koj Cov Servo rau hauv Qhov Ua Haujlwm Zoo Tshaj Tawm: Muab koj muaj cov cuab yeej thiab cov servo koj tuaj yeem tsim qhov no rau hauv ob peb daus las. Tus actuator txuas nrog tus nqi kwv yees li 50mm/min. Nws yog qhov qeeb tab sis muaj zog heev. Saib kuv cov vis dis aus tom kawg ntawm kab ntawv uas tus actuator me me