Hi guys,
I'm working on my first RFID project, involving Arduino and Pure
Data. I use Innovation Id-20 reader and Arduino 2009. I'm stuck in a
problem with "comport".
As I put a transponder near the reader, in Arduino serial monitor I
can see a number like: 495211712056
But in the little patch I attach here, comport reads: 53
This is a problem since more than one transponder give me a "53"
feedback (but a different 12 digits number in Arduino monitor).
Anyone can help me?
Thank you in advance, Luca
lineacurva wrote:
Hi guys,
I'm working on my first RFID project, involving Arduino and Pure
Data. I use Innovation Id-20 reader and Arduino 2009. I'm stuck in a
problem with "comport".As I put a transponder near the reader, in Arduino serial monitor I
can see a number like: 495211712056But in the little patch I attach here, comport reads: 53
This is a problem since more than one transponder give me a "53"
feedback (but a different 12 digits number in Arduino monitor).
53 is the ASCII value of the character '5'. Probably if you add a [print] to the [comport] output you would get a list of 12 ASCII values for each sample.
In Pd you need to accumulate the list of incoming ASCII codes, subtract 48 (ASCII '0') from each, and route them accordingly. A 12-digit number won't display correctly as a float. Probably it's easier in Arduino to make your numbers ints on [0..255] and send them as BYTE. Then you get one number per sample and don't need to handle lists.
Martin
Thank you very much martin,
Adding a "print" to [comport] I see the list of 12 ascii values.
Having a single [0...255] number from Arduino would be easier and
probably the best way to go. But I also wish to understand if pure
data can make the job.
For that I used a [list prepend] [list append] to obtain a list of my
two-digits numbers.
Putting a [print] after [list append] allows me to see the inline list:
print: 48 49 48 52 52 53 69 56 66 56
And that leads me to a more general question: could I compare a list
to another list and obtain a BANG as they match?. At first I was
thinking of using [select], but I don't know if it can manage lists
and how.
Il giorno 10/dic/09, alle ore 19:36, martin.peach@sympatico.ca
martin.peach@sympatico.ca ha scritto:
lineacurva wrote:
Hi guys,
I'm working on my first RFID project, involving Arduino and Pure Data. I use Innovation Id-20 reader and Arduino 2009. I'm stuck in a problem with "comport".
As I put a transponder near the reader, in Arduino serial monitor I can see a number like: 495211712056
But in the little patch I attach here, comport reads: 53
This is a problem since more than one transponder give me a "53" feedback (but a different 12 digits number in Arduino monitor).
53 is the ASCII value of the character '5'. Probably if you add a
[print] to the [comport] output you would get a list of 12 ASCII
values for each sample.In Pd you need to accumulate the list of incoming ASCII codes,
subtract 48 (ASCII '0') from each, and route them accordingly. A 12- digit number won't display correctly as a float. Probably it's
easier in Arduino to make your numbers ints on [0..255] and send
them as BYTE. Then you get one number per sample and don't need to
handle lists.Martin
[list-compare] in the list-abs. It returns 0 or 1. ++
Jack
Le vendredi 11 décembre 2009 à 01:09 +0100, Luca Caridà a écrit :
Thank you very much martin,
Adding a "print" to [comport] I see the list of 12 ascii values.
Having a single [0...255] number from Arduino would be easier and probably the best way to go. But I also wish to understand if pure data can make the job.
For that I used a [list prepend] [list append] to obtain a list of my two-digits numbers. Putting a [print] after [list append] allows me to see the inline list: print: 48 49 48 52 52 53 69 56 66 56
And that leads me to a more general question: could I compare a list to another list and obtain a BANG as they match?. At first I was thinking of using [select], but I don't know if it can manage lists and how.
Il giorno 10/dic/09, alle ore 19:36, martin.peach@sympatico.ca martin.peach@sympatico.ca ha scritto:
lineacurva wrote:
Hi guys,
I'm working on my first RFID project, involving Arduino and Pure Data. I use Innovation Id-20 reader and Arduino 2009. I'm stuck in
a
problem with "comport".
As I put a transponder near the reader, in Arduino serial monitor
I
can see a number like: 495211712056
But in the little patch I attach here, comport reads: 53
This is a problem since more than one transponder give me a "53" feedback (but a different 12 digits number in Arduino monitor).
53 is the ASCII value of the character '5'. Probably if you add a [print] to the [comport] output you would get a list of 12 ASCII values for each sample.
In Pd you need to accumulate the list of incoming ASCII codes, subtract 48 (ASCII '0') from each, and route them accordingly. A 12-digit number won't display correctly as a float. Probably it's easier in Arduino to make your numbers ints on [0..255] and send them as BYTE. Then you get one number per sample and don't need to handle lists.
Martin
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list