On 2013-03-12 09:32, Julian Brooks wrote:
Hi Martin,

Is this with Maxbotic and if so which one?  I'm going to be running the
sensor with an RPi as standalone so presume it's a similar setup (I
believe comport runs fine on RPi)


I use the MB1010 (MaxSonarEZ1). The analog output is very low level and also quite noisy, so a RC filter would be a good idea. The serial output is RS232 on 0-5V, so you need to invert it before reading it with a microcontroller USART input. The format is ASCII but it should be readable in Pd: from the output of [comport] you need to make lists of 4 characters starting with 'R' and convert the last three digits to a single float. That actually looks more reliable than the analog but I haven't tried it. I attached a patch to do that.

With the Pi you probably need to watch out for voltages above 3.3V on the IO pins.

Martin


Would you mind letting me have a look at a patch for translating the
input data (if you use/need one).  I know from utilising xbees that the
input data was tricky to parse - to me anyway.

Cheers,

Julian

On 12 March 2013 13:23, Martin Peach <martin.pe...@sympatico.ca
<mailto:martin.pe...@sympatico.ca>> wrote:

    On 2013-03-12 08:58, Julian Brooks wrote:

        Hi,

        I'm after some advice:

        For an installation piece I'd like to do I'm investigating range
        finder
        sensors (for outdoors).

        Has anyone experience of the Maxbotic URF's and any tips they'd
        like to
        share for getting the data into Pd?


    I connect them to the analog inputs of an Arduino and send the data
    to Pd which reads it using [comport].

    Martin



#N canvas 57 434 568 394 10;
#X text 191 61 <-packet starts with the letter 'R';
#X msg 139 88 0;
#X obj 112 117 f 0;
#X obj 112 12 inlet;
#X obj 143 117 + 1;
#X obj 112 142 pack 0 0;
#X text 173 144 <- prefix each character with its index;
#X obj 112 168 route 0 1 2 3;
#X obj 130 206 - 48;
#X obj 170 206 - 48;
#X obj 210 206 - 48;
#X obj 130 241 * 100;
#X obj 170 241 * 10;
#X obj 170 313 +;
#X obj 155 333 +;
#X obj 155 357 outlet;
#X text 247 206 <- convert ASCII digit to integer;
#X text 215 264 <- combine the decimal digits;
#X obj 139 63 route 82;
#X obj 112 37 t b f;
#X text 112 -7 unpacks a stream of characters from a maxbotix sonar
sensor;
#X text 368 342 Martin Peach 2013_03_12;
#X connect 1 0 2 1;
#X connect 2 0 5 0;
#X connect 2 0 4 0;
#X connect 3 0 19 0;
#X connect 4 0 2 1;
#X connect 5 0 7 0;
#X connect 7 1 8 0;
#X connect 7 2 9 0;
#X connect 7 3 10 0;
#X connect 8 0 11 0;
#X connect 9 0 12 0;
#X connect 10 0 14 0;
#X connect 11 0 13 1;
#X connect 12 0 13 0;
#X connect 13 0 14 1;
#X connect 14 0 15 0;
#X connect 18 0 1 0;
#X connect 18 1 5 1;
#X connect 19 0 2 0;
#X connect 19 1 18 0;
_______________________________________________
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list

Reply via email to