Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MRC522 and Max7219 simultaneously #25

Open
jwilts opened this issue May 29, 2020 · 0 comments
Open

MRC522 and Max7219 simultaneously #25

jwilts opened this issue May 29, 2020 · 0 comments

Comments

@jwilts
Copy link

jwilts commented May 29, 2020

More of a question than a specific issue which I am hoping you can help with.

I am trying to run both an RC522 and MAX7219 (8x8 segment array) both of which use SPI.
In theory I should be able to get both to work however both libraries use PIN24. (SPI0)
Is there a change that I can make to the MFRC library so that I can get both to work? In theory I should be able to use SPI1 (Pin 26) for the reader but then the reader does not work.

I am running Raspian Buster on a few different PI's to try to get this working. (Pi3, Pi Zero etc.)

Below is a short sample of what I am trying to run:
The text runs across the matrix fine, but then fills with random flashing dots and the RFID reader does not read anything.

from luma.core.interface.serial import spi, noop
from luma.core.render import canvas
from luma.core.virtual import viewport
from luma.core.legacy import text, show_message
from luma.core.legacy.font import proportional, CP437_FONT, TINY_FONT, SINCLAIR_FONT, LCD_FONT

import RPi.GPIO as GPIO
from mfrc522 import SimpleMFRC522

reader = SimpleMFRC522()

create matrix device

serial = spi(port=0, device=0, gpio=noop())
device = max7219(serial, cascaded=4, block_orientation=-90)
print("Created device")

show_message(device, "test", fill="white", font=proportional(CP437_FONT), scroll_delay=0.1)

try:
print("Put RFID on Pad")
id, text = reader.read()
print(id)
print(text)
finally:
GPIO.cleanup()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant