8.4 高頻模塊基礎(chǔ)操作_第1頁
8.4 高頻模塊基礎(chǔ)操作_第2頁
8.4 高頻模塊基礎(chǔ)操作_第3頁
8.4 高頻模塊基礎(chǔ)操作_第4頁
8.4 高頻模塊基礎(chǔ)操作_第5頁
已閱讀5頁,還剩45頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

讀取NUIDyuanyc@njcit.cn射頻模塊RC522芯片復(fù)旦卡YFROBOT●

版權(quán)所有◎

ReadNUID|Arduino

1.8.7文件編輯項(xiàng)目

工具

幫助05.Control06.Sensors>07.Display08.Strings>09.USB10.Starterkit_BasicKit

>11.ArduinolSP新建

Ctrl+N打開.

….

Ctrl+O打開最近的項(xiàng)目文件夾示例所有開發(fā)板的示例。AdafruitCircuitPlayground

>Bridge

》Esplora>EthernetFirmata

》GSM

》LiquidCrystal

>Robot

ControlRobotMotorSDSpacebrewYunStepperTemboo已棄用關(guān)閉

Ctrl+W保存

Ctrl+S另存為

Ctrl+Shift+Snew

from

a

PICC

to

serial.頁面設(shè)置

Ctrl+Shift+P

打印

Ctrl+Pcherdetailsand

other

examples

see:https:/readdata

from

a

PICC

(that

is:a

RFID

Tag

o)首選項(xiàng)

Ctrl+逗號關(guān)閉

Ctrl+QAccessControlChangeUIDDumplnfofirmware_checkFixBrickedUIDMifareClassicValueBlock

Minimallnterruptepin

layout

below),load1s,SerialMonitor

of

theistance

of

theMFRC522

Reted.Note:youmay

see"T910111213**

When

theA*

then

verify*

you

present*will

show

t《Arduino/GenuinoMegaorMega2560的例子EEPROMSoftwareSerialSPIWire第三方庫示例Ntag216_AUTHReadAndWriteReadNUIDReadUidMultiReaderRFID-Clonerrfid_default_keysrfid_read_personal_data

rfid_wvrite_personal_dataMFRC522ServoArduino/GenuinoMegaorMega2580,ATmega2Example

sketch/program

showing

how

to

read

new

NUID

from

a

PICC

to

serial.This

is

a

MFRC522library

example;for

further

details

and

other

examples

see:https://github.com/miguelbalboa/rfid*Example

sketch/program

showing

how

to

the

read

data

from

a

PICC(that

is:a

RFID

Tag

or

Card)using

a

MFRC522basedRFID*Reader

on

the

ArduinoSPI

interface.**When

the

Arduino

and

the

MFRC522

module

are

connected(see

the

pin

layout

below),load

this

sketch

into

Arduino

IDE*thenverify/compile

andupload

it.To

see

the

output:use

Tools,Serial

Monitor

of

the

IDE(hit

Ctr1+Shft+M).When*you

present

a

PICC(that

is:a

RFID

Tag

or

Card)at

reading

distance

of

the

MFRC522Reader/PCD,the

serial

output*will

show

the

type,and

the

NUID

if

a

new

card

has

been

detected.Note:you

may

see"Timeout

in

communication"messages*when

removing

the

PICC

from

reading

distance

too

early.*@license

Released

into

the

public

domain.ReadNUID§*MFRC522ArduinoArduinoArduinoArduinoArduino*Reader/PCDUno/101MegaNano

v3Leonardo/MicroPro

Micro**SignalPinPinPinPinPinPin*RST/ResetRST95D9RESET/ICSP-5RST*

SPI

SSSDA(SS)1053D101010*

SPI

MOSIMOSI11/

ICSP-451D11ICSP-416*SPI

MISOMISO12/

ICSP-150D12ICSP-114*

SPI

SCKSCK13

/ICSP-352D13ICSP-315*/19202324252618

Typicalpinlayoutused:

必程序中的管腳定義也需要進(jìn)行修改。將默認(rèn)的UNO中對應(yīng)的管腳10

和9修改為mega板所對應(yīng)的管腳5和53.

31

#include

SPI.h〉31

#include

<SPI.h>32

#include<MFRC522.h>32#include

<MFRC522.h>

改33

33

管腳34

define

SS

PIN

10

34#define

SS

PIN

5335

#define

RST

PIN935

#define

RST

PIN5'36

361田/*

3031

#include

<SPI.h>32

#include<MFRC522.h>3334#define

sS_PIN

1035#define

RST_PIN936MFRC522rfid(SS_PIN,RST_PIN);//Instanceoftheclass3839MFRC522::MIFARE_Key

key;40//Initarray

that

will

store

new

NUIDbyte

nuidPICC[4];434

4

日void

setup(){45

Serial.begin

(9600);46

SPI.begin();//Init

SPI

bus47

rfid.

PCD_Init();//InitMFRC522

484

9

for(byte

i=0;i<6;i++)(程序講解↑

ReadNUID文件編輯項(xiàng)目工具幫助完成模塊連線,3V供電、GND

,IRQ是中斷,用不到可

以不接,其余5個(gè)引腳接法之前已經(jīng)介紹過。RFID

模塊引腳RSTSS/SDAMOSIMISOSCKarduino引腳D5D53D51D50D52→ReadNUID§小

Ex8

*]

Re9

*10

*

Wh11

th12yo13

wi14

wh15自動格式化項(xiàng)目存檔修正編碼并重新加載管理庫

…串口監(jiān)視器串口繪圖器Ctrl+TCtrl+Shift+lCtrl+Shift+MCtrl+Shift+Lhe]aWiFi101Firmware

Updater開發(fā)板:"Arduino/Genuino

Mega

or

Mega2560"處理器:"ATmega2560(Mega2560)"

端口

取得開發(fā)板信息編程器:"AVRISP

mkll'燒錄引導(dǎo)程序>>>>3031

#include

<SPI.h>32

#include<MFRC522.h>

3334#define

ss_PIN5335

#define

RST_PIN5

3637MFRC522

rfid(SS_PIN,RST_PIN);//Instance

of

the

class38MFRC522::MIFARE_Key

key;4041

//Init

array

that

will

store

new

NUID42

byte

nuidPICC[4];

434

4日voidsetup()(45

Serial.begin

(9600);46SPI.begin

();//Init

SPI

bus47

rfid.

PCD_Init

();//Init

MFRC5224849日

for(byte

i=0;i<6;i++)(key.keyByte[i]=0xFF;文

項(xiàng)目

具幫

助ReadNUID§ReadNUID|Arduino

1.8.7

文件編輯項(xiàng)目工具幫助80ReadNUID|Arduino

1.8.10*****32

#include

<MFRC522.h>

3334

#define

ss_PIN5335

#define

RST_PIN

5

3637

MFRC522rfid(SS_PIN,RST_PIN);//Instanceoftheclass

3839

MFRC522::MIFARE_Keykey;4041

//Initarraythat

willstore

new

NUID42

bytenuidPICC[4];4344

日voidsetup()(45Serial

.begin

(9600);46SPI.begin

();//InitSPIbus47

rfid.PCD_Init

();//InitMFRC522

48項(xiàng)目使用了6270字節(jié),占用了(2號)程序存儲空間。最大為253952字節(jié)。全局變量使用了295字節(jié),(3%)的動態(tài)內(nèi)存,余留7897字節(jié)局部變量。最大為8192字節(jié)?!胖靡粡埛弦蟮腟50

卡※放置一張新卡※同一張卡重復(fù)讀取※打開串口監(jiān)視器((按Ctrl+Shft+M)程序運(yùn)行結(jié)果ReadNUID文

項(xiàng)

目ReadNUID§|Arduino

1.8.10工具

助Arduino/Genuino

Mega

or

Mega2500在COM30~56~910~15塊內(nèi)字節(jié)數(shù)芯片唯一序列號及廠商代碼只讀,代碼已固化塊操作,用戶數(shù)據(jù)可讀/可擦/可寫塊操作,用戶數(shù)據(jù)密鑰A存取控制密鑰B用戶存取控制塊操作,用戶數(shù)據(jù)可讀/可擦/可寫塊操作,用戶數(shù)據(jù)塊操作,用戶數(shù)據(jù)密鑰A存取控制密鑰B用戶存取控制…………塊操作,用戶數(shù)據(jù)可讀/可擦/可寫塊操作,用戶數(shù)據(jù)塊操作,用戶數(shù)據(jù)密鑰A存取控制密鑰B用戶存取控制扇區(qū)塊0012310123…………150123Dumplnfo

|Arduino

1.8.7

文件編輯項(xiàng)目

工具

幫助06.Sensors07.Display

>08.Strings

>09.USB

>10.Starterkit_BasicKit

>11.ArduinolSP新建

Ctrl+N打開.

….

Ctrl+O打開最近的項(xiàng)目文件夾0?lata

from

a

PICC

(that

is:a

RFID

Tag

or

Card)^connected(see

thepin

layout

below),load

tr.he

output:use

Tools,Serial

Monitor

of

the

ILCard)

at

reading

distance

of

the

MFRC522

Readecks

it

can

read.Note:you

may

see"Timeout

ir示例所有開發(fā)板的示例。AdafruitCircuitPlayground

BridgeEsploraEthernetFirmata》GSMLiquidCrystalRobot

ControlRobotMotorSDSpacebrewYunStepperTemboo已棄用關(guān)閉

Ctrl+W保存

Ctrl+S另存為

Ctrl+Shift+S頁面設(shè)置

Ctrl+Shift+P

打印

Ctrl+P首選項(xiàng)Ctrl+逗號關(guān)閉

Ctrl+QAccessControlChangeUIDDumplnfofirmware_checkFixBrickedUIDMifareClassicValueBlockMinimallnterruptNtag216_AUTHReadAndWriteReadNUIDReadUidMultiReaderRFID-Clonerrfid_default_keysrfid_read_personal_data

rfid_write_personal_datathePICCs

presented(that

isent

them

to

thereader,itytake

some

time

as

all

dat15161718**

If

your

read*So

if

you

st*details

oft《Arduino/GenuinoMegaorMega2560的例子EEPROMSoftwareSerialSPIWire第三方庫示例MFRC522mega2560(Mega2560)在COM7*Examplesketch/programshowinghow

to

read

data

from

a

PICC

to

serial.*

*ThisisaMFRC522libraryexample;forfurtherdetailsandotherexamplessee:/miguelbalboa/rfid**Examplesketch/programshowinghowtoreaddatafromaPICC(that

is:a

RFID

Tag

or

Card)using

a

MFRC522based

RFID*Reader

on

the

ArduinoSPI

interface.**WhentheArduino

andthe

MFRC522

module

are

connected(see

the

pin

layout

below),load

this

sketch

into

Arduino

IDE*thenverify/compileanduploadit.Toseetheoutput:useTools,SerialMonitoroftheIDE(hitCtrl+Shft+M).When*youpresent

aPICC(thatis:aRFIDTagor

Card)atreading

distance

oftheMFRC522

Reader/PCD,

theserialoutput13*willshow

the

ID/UID,type

and

any

data

blocks

it

can

read.

Note:you

maysee”Timeout

in

communication”messages*whenremovingthe

PICC

from

reading

distance

too

early.15

**Ifyourreadersupportsit,thissketch/programwill

readall

the

PICCs

presented(that

is:multiple

tag

reading).17*Soifyoustacktwo

or

more

PICCs

on

top

ofeachother

and

present

them

to

the

reader,it

will

first

output

all*details

ofthe

first

and

then

the

next

PICC.Note

that

this

may

take

some

time

as

all

data

blocks

are

dumped,so19

*keepthePICCs

atreading

distance

until

complete.Dumplnfo20◎Dumplnfos

▽1

田/*35363738394041424344

日454647484950#include

<SPI.h>#include

<MFRC522.h>#define

RST_PIN#define

SS_PIN553//Configurable,see//configurable,seetypicaltypicalpinpinlayoutlayoutaboveabovevMF

RC522

mfrc522(SS_PIN,RST_PIN);

//Create

MFRC522instancevoi

d

setup(){Seria

l.begin

(9600);//Initialize

serial

communications

with

the

PCwhile(!

Serial

);

//Do

nothing

if

no

serial

port

is

opened

(added

for

Arduinos

baseSPI.begin();

//Init

SPI

busmfrc522.PCD_Init

();

//Init

MFRC522delay(4);//optional

delay.Some

board

do

need

more

time

after

init

to

be

readymfrc522

.PCD_DumpversionToSerial

();//show

details

of

PCD-MFRC522Card

Reader

detai>◎

Dumplnfo|Arduino1.8.10

文件編輯項(xiàng)目工具幫助5960

//Select

one

ofthe

cards61

if

(!mfrc522.

PICC_ReadCardSerial()){62

return;63}

重點(diǎn)!!6465

//Dumpdebuginfoaboutthecard;PICC_Hal+A()isautomaticallycalled6

6mfrc522.

PICC_DumpToSerial(&

(mfrc522.uid));

675354曰void

loop(){55

//Resettheloopifnonewcardpresentonthesensor/reader.Thissaves56曰

if(!mfrc522.

PICC_IsNewCardPresent

()){57

return;58

}◎Dumplnfo

|Arduino

1.8.10文件編輯項(xiàng)目工具幫助Dumplnfo§51

Serial.print1n(F("Scan

PICC

to

see

UID,SAK,type,and

data

blocks..."));

525354

日void

loop(){55//Resettheloopifnonewcardpresentonthesensor/reader.Thissavestheentirer56曰

if(!mfrc522.

PICC_IsNewcardPresent

()){57

return;58

}

5960

//Selectoneof

thecards61曰

if(!mfrc522.PICC_Readcardserial

()){62

return

;63

}

6465//Dump

debug

info

about

the

card;PICC_HaltA()is

automatically

called66

mfrc522.PICC_DumpToSerial(&(mfrc522.uid));※打開串口監(jiān)視器

((按Ctrl+Shft+M)※放置一張符合要求

的S50卡※觀察串口監(jiān)視器的

輸出必注意,整個(gè)讀取過

程卡不能離開讀寫

范圍項(xiàng)目

使

8

4

3

6

字節(jié),占用了(3%)程序存儲空間。最大為253952字

節(jié)

。全局變量使用了279字節(jié),(3)的動態(tài)內(nèi)存,余留7913字節(jié)局部變量。

最大為8192字節(jié)。Arduino/GenuinoMegaor

Mega2580在

COM3讀寫特定扇區(qū)yuanyc@njcit.cn實(shí)驗(yàn)設(shè)備新建

Ctrl+N打開

Ctrl+O打開最近的項(xiàng)目文件夾▲09.USB10.StarterKit_BasicKit11.ArduinolSP▽A示例關(guān)閉

Ctrl+W保存

Ctrl+S另存為….Ctrl+Shift+S所有開發(fā)板的示例。AdafruitCircuitPlaygroundBridgeEsploraEthernet

>Firmata

>GSM

>LiquidCrystal

>Robot

Control

>RobotMotorSDServoSpacebrewYunStepperTemboo已棄用com/miguel

balboa/rfidof

useful

info.Please

read

it.頁面設(shè)置

Ctrl+Shift+P

打印

Ctrl+P首選項(xiàng)

Ctrl+逗號ta

blocks

on

aMIFARE

Classic

PICC關(guān)閉

Ctrl+Q111213141516171819Caru7*BEWARE:Da*★Typical*AccessControlChangeUIDDumplnfofirmware_checkFixBrickedUIDMifareClassicValueBlock

MinimallnterruptNtag216AUTHks

#4

to

#7).*ArduinoLeonardo/MicroArduino/GenuinoMegaorMega2560的例子

EEPROMSoftwareSerialSPIWireReadAndWrite》ReadNUIDReaduidMultiReaderRFID-Clonerrfid_default_keysrfid_read_personal_data

rfid_write_personal_data第三方庫示例MFRC522文件編輯項(xiàng)目工具幫助A:P:piLd**打開文件-示例-MFRC522-ReadAndWrite閱讀程序代碼,思考以下問題必該程序完成的功能是什么?※寫入數(shù)據(jù)在哪個(gè)區(qū),哪個(gè)塊?※寫入數(shù)據(jù)的關(guān)鍵語句是什么?※請修改程序,將數(shù)據(jù)寫入第3扇區(qū)的第二塊。ReadNUID§自動格式化

Ctrl+T項(xiàng)目存檔修正編碼并重新加載管理庫

Ctrl+Shift+I串口監(jiān)視器

Ctrl+Shift+M串口繪圖器

Ctrl+Shift+LWiFi101Firmware

UpdaterPa]Ex89101112131415開發(fā)板:"Arduino/Genuino

Mega

or

Mega2560"處理器:"ATmega2560(Mega2560)"端口》>取得開發(fā)板信息編程器:"AVRISP

mkll"

>燒錄引導(dǎo)程序必程序中的管

腳定義也需

要進(jìn)行修改。

將默認(rèn)的UNO中對應(yīng)的管腳10和9

修改為mega板所對應(yīng)的

管腳5和53.ReadNUID|Arduino

1.8.7文件編輯項(xiàng)目工具幫助Whth

yo

wi

wh*Re******Arduino/Genuino

MegaorMega2580在COM3◎ReadAndWrite

|Arduino

1.8.10文件編輯項(xiàng)目工具幫助D

0ReadAndrite

s25★SPI

MISO

MISO

12

/

ICSP-150D12ICSP-1

1426★

SPI

SCK

SCK

13

/

ICSP-352

D13

ICSP-31527★28*/2930#include

<SPI.h>31#include

<MFRC522.h>3233#define

RST_PIN

5

//configurable,see

typical

pin

layout

above34#define

SS_PIN

53

//Configurable,see

typical

pin

layout

above3536MFRC5

22

mfrc522(SS_PIN,RST_PIN);

//Create

MFRC522instance.3738MFRC522::MIFARE_Key

key;3940日/**41★Initialize.項(xiàng)目使用了8794字節(jié),占用了(3%)程序存儲空間。最大為253952字節(jié)。全局變量使用了307字節(jié),(38)的動態(tài)內(nèi)存,余留7885字節(jié)局部變量。最大為8192字節(jié)。#include<SPI.h>#include

<MFRC522.h>#define

RST_PIN

5#define

SS_PIN

53MFRC522

mfrc522(SS_PIN,RST_PIN);

MFRC522::MIFARE_Key

key;//Configurable,seetypicalpin

layout

above//Configurable,seetypicalpin

layout

above//Create

MFRC522

instance.

※定義引腳并實(shí)例化對象30313233343536373839初始化內(nèi)容

43

void

setup(){44

Serial.begin

(9600);

//Initialize

serial

communications

with

the

PC45

while

(!

Serial

);Do

nothing

if

no

serial

port

is

opened(added

for

Arduinos

based

on

ATMEGA:46

SPI.begin();

Init

SPI

bus47

mfrc522.

PCD_Init();

Init

MFRC522

card

4849//Prepare

the

key(used

both

as

key

A

and

as

key

B)50

//using

FFFFFFFFFFFFh

which

is

the

default

at

chip

delivery

from

the

factory51for

(byte

i=0;i<6;i++){52

key.keyByte[i]=0xFF;

默認(rèn)密鑰,12個(gè)

F,后面讀寫時(shí)用來驗(yàn)證

535455Serial.println(F("ScanaMIFAREClassicPICCtodemonstratereadandwrite."));

Serial.print(F(

"Using

key(for

A

and

B):"));dump_byte_array(key.keyByte,MFRC522::MF_KEY_SIZE

);Serial.println();Serial.println(F("BEWARE:Data

will

be

written

to

the

PICC,in

sector

#1"));串口輸出的

提示信息5657585960初始化61}//Inthissampleweusethe

second

sector,//thatis:sector#1,coveringblock#4uptoandincludingblock#7byte

sector

=1;

扇區(qū)號(0-15可選)byteblockAddr塊號,

(0-63可選)byte

dataBlock[]0x01,Ox02,0x03,0x04,

//1,2,3,4,0x05,Ox06,0x07,0x08,//

5,

6,

7,

8,

16字節(jié)數(shù)組,可作為數(shù)據(jù)寫入塊中0x09,Ox0a,Oxff,0x0b,//9,10,255,11,

全為0的話,即清空該塊數(shù)據(jù)※定義了2個(gè)數(shù)組,

dataBlock[]寫入數(shù)據(jù),

buffer[18]

讀回內(nèi)容※MFRC522

庫中的MIFARE_Read

方法需要一個(gè)至少18個(gè)字節(jié)的緩沖區(qū)來保存一個(gè)塊的16個(gè)字節(jié)。MFRC522::StatusCode

status;byte

buffer[18];

新的數(shù)組,用來讀取塊中的數(shù)據(jù)

byte

size

=

sizeof(

buffer

);//12,13,14,15對應(yīng)扇區(qū)的控制塊地址(3,7,11

...等)0x0c,Ox0d,Ox0e,0xOf};bytetrailerBlock=7;919293949596979899100101102103104105120

//Readdata

from

the

block121Serial.print(F("Readingdatafrom

block

"));Serial.print(blockAddr);122

Serial.print1n(F("..."));123

status=(MFRC522::StatusCode)mfrc522.MIFARERead(blockAddr,buffer,&size);124if(

status

!=

MFRC522::

STATUS_0K){

讀取塊數(shù)據(jù),參數(shù)包含塊地址,數(shù)據(jù),字節(jié)數(shù)125

Serial.print

(F("MIFARE_Read()failed:"));126

Serial.println(mfrc522.

GetStatusCodeName(status

));127128

Serial.print(F("Datainblock"));Serial.print(blockAddr);Serial.println(F(":"));129

dumpbytearray(buffer,16);

Serial.println();130

Serial.println

();

函數(shù)定義在程序最后,串口顯示數(shù)組中的數(shù)據(jù)131讀取塊數(shù)據(jù)必注意,讀取操作之前,需進(jìn)行密鑰A驗(yàn)證//Write

data

to

the

blockSerial.print(F("Writingdataintoblock

"));Serial.print(blockAddr);Serial.println

(F(”..."));dump_byte_array(dataBlock,16);Serial.println();status=(MFRC522::StatusCode)mfrc522.MIFAREWrite(blockAddr,dataBlock,16);必寫入數(shù)據(jù)的關(guān)鍵函數(shù)必注意,寫入操作之前,需進(jìn)行密鑰B驗(yàn)證if(status!=MFRC522::

STATUS_0K){Serial.print

(F("MIFARE_Write()failed:"));Serial.println(mfrc522.

GetStatusCodeName(status

));寫入數(shù)據(jù),參數(shù)包含塊地址,數(shù)據(jù),字節(jié)數(shù)141142143144145146147148149150151Serial.println();思考與練習(xí)必請修改程序,把剛才改寫的數(shù)據(jù)清零必請修改程序,將數(shù)據(jù)寫入第3扇區(qū)的第。二塊,并完成驗(yàn)證。數(shù)值塊的操作yuanyc@njcit.cnwallet|Arduino

1.8.10文

項(xiàng)目

助Robot

MotorSDServoSpacebrewYunStepperTemboo已棄用AccessControlChangeUIDDumplnfofirmware_checkFixBrickedUIDMifareClassicValueBlock

MinimalnterruptNtag216AUTHReadAndWriteReadNUIDReadUidMultiReaderRFID-Clonerrfid_default_keys新建

Ctrl+N打開.

….

Ctrl+O打開最近的項(xiàng)目文件夾示例關(guān)閉

Ctrl+W保存

Ctrl+S另存為

Ctrl+Shift+SArduino/Genuino

Mega

or

Mega2560的例子EEPROMSoftwareSerialSPIWire頁面設(shè)置

Ctrl+Shift+P打印

Ctrl+P首選項(xiàng)

Ctrl+逗號第三方庫示例rfid_read_personal_datarfid_write_personal_data關(guān)閉

Ctrl+QMFRC522※數(shù)值:有符號4字節(jié)數(shù)值。數(shù)值的最低字節(jié)存儲在最低地址字節(jié)。負(fù)值以標(biāo)準(zhǔn)的2

的補(bǔ)碼形式存儲?!?/p>

出于數(shù)據(jù)完整性和安全原因,數(shù)值存儲三次,兩次不取反,

一次取反?!?/p>

·地

址(Adr):1

字節(jié)地址,當(dāng)進(jìn)行備份管理時(shí),可用于保存塊的地址。地址保

存四次。兩次取反,兩次不取反。在increment

、decrement

、restore

和transfer操作中,地址保持不變。它只能通過write命令更改。字節(jié)號0123456789101112131415存儲內(nèi)容ValueValueValueAdrAdrAdrAdr說明有符號4字節(jié)數(shù)值,存儲三次,兩次不取反,一次取反。

值的最低字節(jié)存儲在最低地址字節(jié)。1字節(jié)地址,存四次,

其中兩次取反。數(shù)值塊的存儲結(jié)構(gòu)※數(shù)值塊有固定的數(shù)據(jù)格式,以便于錯(cuò)誤檢測、糾錯(cuò)和備份管理。數(shù)值塊只能通過

以數(shù)值塊格式的寫操作生成:實(shí)驗(yàn)設(shè)備wallet

|Arduino

1.8.10文件編輯項(xiàng)目工具幫助RODot

ControlRobot

MotorSDServoSpacebrewYunStepperTemboo已棄用AccessControlChangeUIDDumplnfofirmware_checkFixBrickedUID新建

Ctrl+N打開

Ctrl+O打開最近的項(xiàng)目文件夾MifareClassicValueBlock示例MinimallnterruptNtag216_AUTHReadAndWriteReadNUIDReadUidMultiReaderRFID-Clonerrfid_default_keysrfid_read_personal_datarfid_write_personal_data關(guān)閉

Ctrl+W保存

Ctrl+S另存為

…Ctrl+Shift+SArduino/Genuino

Mega

or

Mega2560的例子EEPROMSoftwareSerialSPIWire頁面設(shè)置

Ctrl+Shift+P打印

Ctrl+P首選項(xiàng)Ctrl+逗號第三方庫示例關(guān)閉

Ctrl+QMFRC5221

0/

/

第*ThisisaMFRC522libraryexample;see

/miguelbalboa/rfidforfurtherdetails

and

other

examples.NOTE:ThelibraryfileMFRC522.hhasalotofusefulinfo.Pleasereadit.Releasedintothepublicdomain.土BEWARE:Data

will

be

written

to

the

PICC,insector#1(blocks#4to#7).Typicalpinlayoutused:★This

sample

shows

how

to

setup

blocks

on

a

MIFARE

Classic

PICC(=card/tag)to

be

in

"Value

Block"mode:in

this

mode

the

operations

Increment/Decrement,RestoreandTransfercanbeused.土注釋可知,該例程可以將數(shù)據(jù)塊設(shè)置為“數(shù)值塊”的模式支

持如加值、減值等等額外的功能MifareClassicValueBlock★★ReadNUID|Arduino

1.8.7文件編輯項(xiàng)目工具幫助自動格式化

Ctrl+T項(xiàng)目存檔ReadNUIDS

修正編碼并重新加載小

E

x管理庫

…Ctrl+Shift+l8

*Re

串口監(jiān)視器

Ctrl+Shift+M9

串口繪圖器

Ctrl+Shift+L10

Wh

WiFi101

Firmware

Updater11

th

開發(fā)板:"Arduino/GenuinoMegaorMega2560°

>

he

處理器:"ATmega2560(Mega2560)"

>12

yo端

>13

*wi.

取得開發(fā)板信息

a14

*wh

編程器:"AVRISP

mkll"

>15

*

燒錄引導(dǎo)程序3536

#include<SPI.h>37

#include

<MFRC522.h>

3839#defineRST_PIN

5

//40#defineSS_PIN

53

//

4142

MFRC522

mfrc522(SS_PIN,RST_PIN);/

43程序中的管腳定義也需要進(jìn)行修改。將默認(rèn)的UNO

中對應(yīng)的管腳10和

9修改為mega板所對應(yīng)的管腳5和53.***AScanaMIFAREClassicPICCtodemonstrateValueBlockmode.

Using

key(for

A

and

B):FF

FF

FF

FF

FF

FFBEWARE:Data

will

be

written

to

the

PICC,in

sector

#1?自動滾屏□Show

timestamp

換行符

9600波特率

清空輸出COM4發(fā)送ScanaMIFAREClassic

PICC

to

demonstrate

Value

Block

mode.Usingkey(forAandB):FFFF

FF

FF

FF

FFBEWARE:Datawillbewrittento

thePICC,in

sector

#1Card

UID:A78E

2176

顯示卡片UID和類型PICCtype:MIFARE

1KB

Authenticating

using

key

A...Current

data

in

sector:1

7

000000000000FE

078069

FF

FF

FE

FE

FF

FF

[001]6

00000000000000000000000000000000[000]500000000000000000000000000000000

[000]400000000000000000000000000000000[000]Reading

sector

trailer...Writing

new

sec

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論