RFID Parallax Module and a DS1302 And different routine for each card
sam_sam_sam
Posts: 2,286
Hi everyOnne
I am at it again with a New Project Idea
I want take RFID Card # and access a different routine for each card
This is an example of code that i want to use for two different RFID Cards
Card # 1
IF ((minutes = 0) AND (seconds = 1)) THEN
HIGH 13
ENDIF
IF ((minutes = 15) AND( seconds = 0)) THEN
LOW 13
ENDIF
Card # 2
IF ((minutes = 0) AND (seconds = 1)) THEN
HIGH 13
ENDIF
IF ((minutes = 30) AND( seconds = 0)) THEN
LOW 13
ENDIF
RFID reader and a DS1302 clock chip
Can this be done ? and (if this can be done)
Could you PLEASE give an example on how to this
THANKS to any one that show me how to this
Please let know if this can be done
Sam
Post Edited (sam_sam_sam) : 5/8/2006 10:05:09 PM GMT
I am at it again with a New Project Idea
I want take RFID Card # and access a different routine for each card
This is an example of code that i want to use for two different RFID Cards
Card # 1
IF ((minutes = 0) AND (seconds = 1)) THEN
HIGH 13
ENDIF
IF ((minutes = 15) AND( seconds = 0)) THEN
LOW 13
ENDIF
Card # 2
IF ((minutes = 0) AND (seconds = 1)) THEN
HIGH 13
ENDIF
IF ((minutes = 30) AND( seconds = 0)) THEN
LOW 13
ENDIF
RFID reader and a DS1302 clock chip
Can this be done ? and (if this can be done)
Could you PLEASE give an example on how to this
THANKS to any one that show me how to this
Please let know if this can be done
Sam
Post Edited (sam_sam_sam) : 5/8/2006 10:05:09 PM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
If I am understanding you correctly, you can accomplish this by taking any of the "standard" RFID demo code and after the read (you should be able to figure out where in the code this is), use a LOOKDOWN, CASE or IF-THEN construct to decide where to go for each card. Each one of your segments (Card #1, Card #2) will end up being a subroutine that gets called by the appropriate card.
Now, based on your previous messages, you really need to go through the "What's a Microcontroller?" text and get a better understanding of how a program is intended to flow...before asking "well, how do I do that?". I understand that sometimes the best teacher is example, but you need to really understand "why" you do certain things to really get effective use out of your investment...otherwise, each project becomes another cycle of asking "how"...without ever really getting the satisfaction of figuring it out, and the knowledge that, with time, you can work it out for yourself...
<philosopher_mode=OFF>
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...
Thank you for your reply
The problem i was having was i did now what the label was in the code to use
But i did figuring it out that " TAG NUM = What ever # "
Was what·i need to use
TO·use a LOOKDOWN, CASE or IF-THEN construct to decide where to go for each card. Each one of your segments (Card #1, Card #2) will end up being a subroutine that gets called by the appropriate card.
Now i do go through the "What's a Microcontroller?"· my problem is understanding how to use
the examples to do what i want to do and you are right
But i do understand it better with examples i just learn it better that way
Please for give for that
·I know that is MY Problem
Thank YOU for helping in this matter
This is what i was able to come up with
PLEASE tell me if i have the Right Idea or not ( This· dose work )
Sam
Thanks for for your reply
Sam········
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Lets says what i want to is take this CARD # 1
and use this routine
"0F026079ED" is Card #1
IF mins = $00 AND secs =$00 THEN
HIGH Relay
ENDIF
IF mins = $15 AND secs =$00 THEN
LOW Relay
ENDIF
And use this routine for this CARD # 2
"0F02782A89" is Card #2
IF mins = $00 AND secs =$00 THEN
HIGH Relay
ENDIF
IF mins = $30 AND secs =$00 THEN
LOW Relay
ENDIF
And So On................
What i want to do is to use different CARD #
To have Different TIME routine
Thanks For Your HELP Chris
Sam
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
OS-X: because making Unix user-friendly was easier than debugging Windows
·· We have calrification...After a phone conversation this is what we have...
1) Scan A Tag (branch to a given routine based on the tag number.· To do this you could use the RFID code and change the display name section to an ON tagNum BRANCH Routine1, Routine2, Routine3, etc.
Routine1:
··mins=$00
··secs=$00
· GOSUB Set_Time
··HIGH Relay
· DO
····GOSUB Get_Time
··· IF mins=$15 AND secs=$00 THEN EXIT
· LOOP
· LOW Relay
· GOTO Start
·
Once the desired time was reached you would branch back to the beginning to wait for the next tag.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Thanks Now i know what you are talking about
Thank You For All Of Your Help
Sam
Thank You for helping understand how to use the ON GOSUB
I have not use this command before BECAUSE i did NOT understand how to use it
Syntax: ON Offset GOSUB Address1, Address2, ...AddressN
IF (value = 0) THEN GOSUB Case_0
IF (value = 1) THEN GOSUB Case_1
IF (value = 2) THEN GOSUB Case_2
Here is what i came up with and it works VERY GOOD
THANK YOU FOR ALL YOUR HELP Chris
Sam
Post Edited (sam_sam_sam) : 5/10/2006 9:41:04 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Thank YOU for your reply
I was not sure how to write this command
BRANCH tagNum, label1, label2, label3,
Thank You for helping me to understand how to use this command
Sam
·· The syntax and examples are listed in the Help File in the Stamp Editor as well as the BASIC Stamp Manual.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
I am still working on this project i need some help with this problem that i have
when i was taking the project board and putting it in the case one of the wires
on DS1302 chip broke loose and i did not see that it had broke loose
So the power relay came ON like it was supost to but the clock was not running
So the way i had code writen in CARD_READER_TIMER.bs2 it would turn ON the Relay
if the clock was NOT RUNNING
'So i add this line so that if the DS1302 is not running it will not turn ON the Relay At START UP
IF mins = $00 AND secs =$05 THEN
HIGH Relay
What i want to know is there a way to keep track of the timer and if it STOPS RUNNING that
it turns OFF the RELAY
Can this be done and if it can be done how would you write the the code routine
Thanks to anyone that can help with this
Routine1:
mins=$00
secs=$00
GOSUB Set_Time
IF mins = $00 AND secs =$05 THEN 'So add this line
HIGH Relay
DO
GOSUB Get_Time
IF mins=$15 AND secs=$00 THEN EXIT
LOOP
LOW Relay
GOTO Start
Sam
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Franklin
You Said this
If you have some time for a test you could check seconds twice in a minute and if they are the same the clock is not running.
I understand what you are talking about
I thought about check Seconds To A Minute
But i do not how to write it
How would i TEST Second Twice in a Minutes
Can you give an example of how to do that or where i can find an example of how to it
I want to learn how to this
I have two or three project that i will need to have this SAFETY Built in to Code so that if the Clock dose not run it will not turn ON The Relay
I will also need to learn how to put in a SAFETY KILL SWITCH in one project that i will be working on soon also with the Clock Not Running Safety
So THANK YOU FOR ANY HELP that you can give in this matter and THANK YOU for you TIME
Sam
I·have move this new problem that i am having to this Post
·DS1302 Is there a way to keep track of the timer if it is running
http://forums.parallax.com/showthread.php?p=594278
Sam