ofSerialTest problem... serial event?

Okay so I’m having some strange behavior coming out of the ofSerialTest example…

on first click:
LED on Arduino blinks, but nothing read back into OFW…

second click:
LED blinks, bunch of garbage

third click:
bunch of garbage again…

I programmed my arduino using the example code… the only thing I modified is what pin my LED is on. The call/response works fine from the serial monitor in Arduino:

I tried this on a couple of different Macs, both Tiger.

Any thoughts?

I don’t suppose there is something already in OFW like a serial event (ie. mousePressed, keyPressed)? If not, I’m wondering how I would go about coding it myself…

Thanks kindly,


what platform? what compiler?

can you try 0.05 - if you are on xcode or devcpp:
and see if it works?
we have made some changes, via joerg’s suggestions of reading writing in chars, not strings.


some other questions – does a simple processing sketch return good data?

for me, callback raises the following questions:

a) how many bytes do you try to read from the serial to know that you get a callback in the first place? ie, serial isn’t push driven, it’s pull driven, that you pull data.

b) i think you’d get some mad latency issues, since you would be able to flush the buffer (ie, read as much as possible) w/ a callback driven system

the answer is probably something like the firmata protocol, which erik’s been working on (See cppglue)…

take care!

Thanks for the advice, zach.

I was following the string/byte serial thread, but will give it a more careful look.

Processing consistently gets data returned on the fifth try…

even if i put delays of 500ms in between frames… the magic number is always five sends calls before a response. :shock:

I am on Xcode 2.4.1 IDE… I think GCC 4.0 is the compiler?

trying 005… will report back


005 try: works (almost) perfectly


i still get just an LED blink on the first click, but at least the subsequent clicks seem okay. Will be doing more testing tonight and tomorrow, seeing if im getting old bytes.

I am using the Arduino Decemilia board, and someone is telling me that they had the same problem… maybe something funny with that.

… :shock: C

the problem may have related to the conversion of ofSerial to use strings, which was a mistake we made in 0.04 when we started putting strings everywhere. Joerg posted fixes in the forum about this. I didn’t see a problem on my board, but it could be something wrong with logic (anyway, communicating binary data in a strings a terrible idea).

happy that helps!!

take care,