Forums > MaxMSP

max > servo controller SSC-32

June 1, 2007 | 3:23 pm

hi,
I


June 1, 2007 | 4:21 pm

i don’t have SSC card or my own code at hand, but i think this should
work. Basically, you have to trigger cr (carriage return, ascii 13) by
hand, using "trigger 13" object. don’t forget to put it on the left of
spell, so that it triggers after spell outputs ascii codes.

max v2;
#N vpatcher 463 425 1063 825;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 96 176 29 196617 t 13;
#P number 138 44 35 9 500 1200 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 138 137 31 196617 spell;
#P message 138 78 47 196617 $1 P $1;
#P newex 138 227 77 196617 serial b 38400;
#P fasten 1 0 4 0 143 111 101 111;
#P connect 3 0 1 0;
#P connect 1 0 2 0;
#P connect 2 0 0 0;
#P fasten 4 0 0 0 101 206 143 206;
#P pop;


June 1, 2007 | 5:34 pm

thanx, for your answer.
but still just the green light blinks.
I wonder why it should be so difficult: when I save the patch and reopen it, I get a $ instead of #. (may be the characters are not possible to send).
the servos and the controller work with PD patch (see picture), so that I can send OSC, but I wanna make one patch in max/msp(including video tracking)
I also have installed "prolific usb2rs232(PL2303_1.0.8.pkg)", but maybe there


June 2, 2007 | 7:51 am

i’m picking my computer, card, etc from the exhibition space today, so
by the evening you should get small working patch.

but, as far as i can see, serial object is not assigned to the right
serial port. try sending message "print" to serial object. in the max
window, you should see all available serial ports. try to guess which
one is the right one, and use it in serial object instead of b. if
this doesn’t work, try other letters (by alphabetical order) , like c,
d, e……

also, check baudrate settings, parity, stopbit, etc

good luck

klif


June 2, 2007 | 9:44 pm

here’s a basic patch. you’ll have to change serial object argument to
match your serial port, and also check that baud settings in serial
object and SSC card are the same (on a card, you change baud setting
via jumpers).

sometimes there is a problem with # sign after saving max patch, if
it’s used in message boxes. i guess this is because max uses same
symbol for assigning arguments to patchers. one of the possible
solutions is to use sprintf object to format messages (instead $1 in
message box, you use %ld in sprintf object).

klif

max v2;
#N vpatcher 101 108 485 411;
#P newex 74 132 49 196617 s serialA;
#P comment 138 50 72 196617 servo speed;
#P number 139 63 35 9 10 10 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 74 86 75 196617 pack 1000 100;
#P number 74 64 35 9 500 2000 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 74 108 104 196617 sprintf $0P%ld S%ld;
#P newex 74 183 27 196617 t 13;
#P newex 74 159 49 196617 r serialA;
#P newex 74 208 95 196617 serial a 9600 8 1 0;
#P newex 103 183 29 196617 spell;
#P comment 40 50 72 196617 servo position;
#P connect 6 0 7 0;
#P connect 7 0 5 0;
#P connect 5 0 10 0;
#P connect 3 0 4 0;
#P connect 4 0 2 0;
#P fasten 1 0 2 0 108 204 79 204;
#P fasten 3 0 1 0 79 179 108 179;
#P connect 8 0 7 1;
#P pop;


June 3, 2007 | 1:32 pm

juhuuu!
thank you so much for your help and patch.
it was the sprintf, to translate # and P!
great. it works now ;)
andrea


June 3, 2007 | 6:28 pm

great!

good luck with your project!


Viewing 7 posts - 1 through 7 (of 7 total)