-3

I am trying to code a RFID access system that utilizes an actuator to turn on and off. I followed a simple tutorial that can be found here.

I completed the tutorial fully and now have encountered problems:

  1. I noticed when following the tutorial, the "python" we were coding was different from actual Python... for example, we don't do the curly brackets to end anything. Is there a way I can program and have access to my RFID module with the normal "Python" that I learned?
  2. I am having issues finding the syntax's attached to SimpleMFRC522, because from what I read, it is a simplified way to interact with the RFID reader. So shouldn't there be certain syntax/functions attached to it?
  3. When running a simple program that reads a tags ID and TEXT associated with the tag, I come across errors that usually wouldn't be an error on the normal python, for example...

    Python Code

    After running that code (labeled 'Python Code'), I come across...

    Actual Error

I am extremely confused and need guidance or referral to anything I could possibly learn to help me finish this project. All or any help is appreciated and seriously considered.

5
  • 2
    Those look like normal python errors to me Commented Jul 24, 2018 at 15:18
  • 1
    There are no "curly brackets" on the linked tutorial Commented Jul 24, 2018 at 15:19
  • 3
    Don't post code as images. Or errors. Format as text please. Commented Jul 24, 2018 at 15:19
  • 1
    The error you see is completely expected from the code you posted. It's just bad code. What is the actual question? Commented Jul 24, 2018 at 15:20
  • Thank you for all your inputs, I will take all of it into consideration next time and will come back with better questions. Commented Jul 24, 2018 at 15:28

1 Answer 1

0

Similar issue to this post.

You cannot concatenate a string and an integer so you must pull the id out of the object then typecast it to a string:

unsure what the 'id' name is within the object but let's assume it's 'id'

... (code above)

try:
    print('Place your tag to be read.')
    id_obj, text = reader.read()
    print('Your ID is ' + str(id_obj.id))
    print('Your text is ' + text)

... (code below)
Sign up to request clarification or add additional context in comments.

2 Comments

Thank you, this is exactly what I was looking for. I apologize for such a newby, poorly-written question. My extreme confusion and lack of knowledge on these topics lead to this.
no worries but, as the other comments suggest, in the future it would help if you provide the raw code in a format that people can easily manipulate

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.