Go Down

Topic: Messenger library (Read 26 times) previous topic - next topic

tof

You are right.
Messenger only provides methods for incomming messages. The examples demonstrates how to receive messages with Messenger's messageCompleted() callback function but also demonstrates how to send messages so they can be parsed with the matching Messenger libraries for Max or Processing.
Thomas Ouellet Fredericks

yair

i might be missing something there, the comment of the example im refering to is
Code: [Select]
This example parses a message that contains the values
of an Arduino's analog inputs and displays them as rectangles.
The message must be composed of the readings of the 6 inputs.
Each readingis separated by a space (' ') and terminated
by a carriage return and line feed


is there somehwere an example with processing>arduino communication. i tried using the simpleMessage examples but that didnt work. those messanger support the simpleMess protocol
Code: [Select]
r a -> read analog pins
r d -> read digital pins
w d [pin] [value] -> write digital pin
w a [pin] [value] -> write analog pin


yair

#27
Dec 06, 2009, 10:15 pm Last Edit: Dec 07, 2009, 12:25 am by yair Reason: 1
as a matter of fact i thinkn all this software protocols between arduino and the computer are bad education. i searched for serial.flush() and was directed to http://todbot.com/blog/2009/07/30/arduino-serial-protocol-design-patterns/, i think this is the direction should go.
tommorow i have to explain conditions to a seeduino mega and a processingxp

this looks so shinny, waht does it do?
Code: [Select]

Beside the 2 following improvements:

 1. define the variables as unsigned char

    unsigned char rx_buffer_head = 0;
    unsigned char rx_buffer_tail = 0;

 2. use the following code to wrap the values

    rx_buffer_tail = rx_buffer_tail + 1;
    rx_buffer_tail %= RX_BUFFER_SIZE;

 3. Tweak buffer size for your application.

what else can be done to improved the performance of Hardware Serial?  I am stuck using 4800 baud

thanx

Mart

tof

Hi Yair,

I will try to understand your posts as best as I can.
The Processing example supplied with the Messenger library works very with the Arduino example provided.

Quote
I might be missing something there, the comment of the example im refering to is [...] is there somehwere an example with processing>arduino communication. i tried using the simpleMessage examples but that didnt work. those messanger support the simpleMess protocol


As stated in Messenger's documentation: All of your host software code that you designed for SimpleMessageSystem should still be compatible with Messenger. You will simply have to modify your Arduino code.

So you need to modify the Arduino code to match the software code.

I think the simplest solution for you would be to use Firmata (try my version here)

Also check this post out.
Thomas Ouellet Fredericks

yair

im using a mega, which is unsupported (the changelog tells it does, everyone else it doesnt).
thanks for your support, i will have to warp my head around bytes eventually. i think its for the best.
i used some code from the previous link i mentioned and from this megaServo example.

Go Up