View previous topic :: View next topic |
Author |
Message |
petur
Joined: 26 Mar 2010 Posts: 5
|
Getting RFID tag and character from computer not work 2gethe |
Posted: Wed Apr 28, 2010 5:57 am |
|
|
Hi,
I want to get the tagnumber of an RFID tag and to output low the Yellow LED after getting a character "A" via rs485, but not work together.
Here is my code
Code: |
while (TRUE)
{
output_high(RED_LED);
if(read_4102(msg))
{
output_low(RED_LED);
customerCode=msg[0];
tagNum=make32(msg[1], msg[2], msg[3], msg[4]);
//sprintf(msg, "Customer code: %u\n\r", customerCode);
// RS485send(msg);
sprintf(msg, "%lu\n\n\r", tagNum);
RS485send(msg);
}
if(toupper(RS485getc())=='A')
{
output_low(YELLOW_LED);
}
}
|
The code works fine, but only for one IF case. How can I make to work it together ? |
|
|
petur
Joined: 26 Mar 2010 Posts: 5
|
|
Posted: Wed Apr 28, 2010 9:58 am |
|
|
Anybody ? Plz |
|
|
sjb
Joined: 13 Apr 2010 Posts: 34 Location: UK
|
|
Posted: Thu Apr 29, 2010 3:00 am |
|
|
It might be difficult to make any suggestions unless you say what it actually does wrong.
There are no comments in your code to help the reader.
Could it be that RS485getc() blocks until a user presses a key?
(also I feel that the use of text-speak gobbledygook like '2gthe' and 'plz' in you title and post is likely to give a bad impression and should be avoided in posts to forums - apart from making you sound like a prepubescent school kid it's disrespectful and a hindrance to communications with non-english speakers). |
|
|
|