Skip to content

Commit c4117f7

Browse files
2 parents 06425f9 + 731e391 commit c4117f7

File tree

4 files changed

+430
-386
lines changed

4 files changed

+430
-386
lines changed

docs/kits/rfid-rc522/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,6 @@ except KeyboardInterrupt:
9494

9595
## References
9696

97+
* [How To Electronics: Using RC522 RFID Reader Module with Raspberry Pi Pico](https://how2electronics.com/using-rc522-rfid-reader-module-with-raspberry-pi-pico/)
9798
* [Dan J Perron Driver](https://github.com/danjperron/micropython-mfrc522/blob/master/mfrc522.py)
9899
* [Microcontrollers Lab Tutorial](https://microcontrollerslab.com/raspberry-pi-pico-rfid-rc522-micropython/)

mkdocs.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,24 @@ theme:
204204
# should be name: material
205205
name: material
206206
logo: img/coderdojo-logo.png
207+
icon:
208+
previous: fontawesome/solid/angle-left
209+
next: fontawesome/solid/angle-right
207210
palette:
208211
primary: '#642580'
209212
accent: '#41BAC1'
210-
custom_dir: 'theme'
213+
# custom_dir: 'theme'
211214
include_sidebar: true
215+
features:
216+
- content.code.copy
217+
- navigation.expand
218+
- navigation.path
219+
- navigation.prune
220+
- navigation.indexes
221+
- toc.follow
222+
- navigation.top
223+
# this adds the prev and next icons in the footer
224+
- navigation.footer
212225
plugins:
213226
- search
214227
# - mermaid2 - takes too long to build - use a screen image for now

src/kits/rfid-rc522/lib/carl.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# data_read.py
2+
from mfrc522 import MFRC522
3+
import utime
4+
import machine
5+
from time import sleep
6+
# from ssd1306 import SSD1306_I2C
7+
8+
reader = MFRC522(spi_id=0,sck=6,miso=4,mosi=7,cs=5,rst=22)
9+
10+
# i2c = machine.I2C(0, sda=machine.Pin(16), scl=machine.Pin(17))
11+
# setup the display driver using the i2c interface
12+
# oled = SSD1306_I2C(128, 64, i2c)
13+
14+
print("Bring TAG closer...")
15+
print("")
16+
17+
18+
while True:
19+
reader.init()
20+
(stat, tag_type) = reader.request(reader.REQIDL)
21+
print(stat)
22+
if stat == reader.OK:
23+
24+
(stat, uid) = reader.SelectTagSN()
25+
if stat == reader.OK:
26+
card = int.from_bytes(bytes(uid),"little",False)
27+
print("CARD ID: "+str(card))
28+
# oled.fill(0)
29+
# oled.show()
30+
# oled.text(str(card), 0, 0)
31+
# oled.text("Line2", 0, 15)
32+
# oled.show()
33+
utime.sleep(1)

0 commit comments

Comments
 (0)