Shop OBEX P1 Docs P2 Docs Learn Events
Java in Processing Return To Default Code Help — Parallax Forums

Java in Processing Return To Default Code Help

ChelseaByersChelseaByers Posts: 1
edited 2014-08-08 10:19 in Robotics
Hi guys!

I am dabbling in RFID for a project I'm working on. Basically speaking, I have designed an application for a company who sells product. This application will include a TV screen and an RFID reader near their product. When a customer places a product (with a chip in it) on the RFID reader pad, the TV switches from a default video to information about that product. Super simple. The problem is that when I remove the product (and chip) from the reader I want it to default back to the video that was playing and can't seem to get the code to understand that.

I am currently running the RFID reader through Processing (in Java mode) using IF ELSE statements, though this may not be the best way to go. My question is if you could help provide the best code to try to get the RFID reader to default back to a video when no chip is present in its' vicinity.

If you don't know personally, any direction towards someone you know who could possibly help me would be greatly appreciated.

Thank you so, so much for any help!
Chelsea

Comments

  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2014-08-05 15:07
    Did you try else if in your Java code ? it in a format such as :

    if (condition 1) {
    }

    else if (condition 2) {
    }

    else (condition 3) {
    }
  • SRLMSRLM Posts: 5,045
    edited 2014-08-05 19:04
    If I remember right the RFID reader outputs a string of characters as soon as it can read a tag, and won't output anything when the tag moves away. You should test that, and if that is the case your only option is a timeout: display the product information for 30 seconds or another product is scanned, whichever comes first.
  • JordanCClarkJordanCClark Posts: 198
    edited 2014-08-08 10:19
    The RFID Read/Write module, however is sent a read request. If you can put a timeout value along with it, you can tell if there's no tag.
Sign In or Register to comment.