Go Down

Topic: Event-Based Library for Arduino (Read 15 times) previous topic - next topic


Jul 31, 2011, 06:30 pm Last Edit: Jul 31, 2011, 06:35 pm by Rferreira Reason: 1
There is nothing special in this "serial oriented" way. If I can "sendByte" here and then "readByte" there it will work independent of transport layer. It's only an validation sequence as explained bellow:

1) If there is nothing in buffer, I just wait for an STX byte because it tells me that a message is arriving;

2) Once a message started to arrive, I will first read its header. In case of AdvancedSerial it has a fixed size and it also brings the payload size;

3) If I have a valid payload size I start to fetch it from buffer;

4) When I finish reading the payload, then the next byte must be an ETX telling me that's the message ended.

If anything went wrong on validation we loose the message, otherwise we send back an ACKNOWLEDGE message. Once we combined ACK messages with a timeout+retry algorithmic we have a well reliable communication.

Maybe you need talk to arduino using USB, ethernet, TX/RX or whatever. The idea is to fit any project requirement as possible with the same protocol implementation, being it an offline configurator or even an real-time monitor.

Would be good if there was a RF24 hub or a usb dongle for it as well. The last one I think that we can quickly build by ourselves.

Finaly, using a common protocol implementation over any transport layer permit us to use different transport layers at same communication through converters like Serial2Ethernet and so on. Then one part can use their serial support while another one use the ethernet support and achieve a transparent communication.


Would be good if there was a RF24 hub or a usb dongle for it as well. The last one I think that we can quickly build by ourselves.

Hi Renato,

I've been looking for one. Take a look at this:

I found this at a supplier but don't have one yet.. and very little data.

Also Nordic site says their System-On-Chip with nRF24L01 can have USB ??

I'll try to find more info...

Regards, Terry King
...In The Woods In Vermont
Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info


Hmmm! Looks good...  8)  It made me curious...


Hi Renato,

I am just getting back to Arduino because your library finally promises to make it more pleasant! I'm using Arduino 1.0 on a Mac.

I just downloaded the Zip file and put it into arduino's libraries folder. When I open file/examples/buttonEvent/simplebutton and click "Verify" I get several compile errors. Does it look like I am doing something wrong? I get other compile errors with the other EBL examples.


In file included from SimpleButton.cpp:1:
/Applications/Arduino 1.0.app/Contents/Resources/Java/libraries/ButtonEvent/ButtonEvent.h:33:22: error: WProgram.h: No such file or directory
In file included from SimpleButton.cpp:1:
/Applications/Arduino 1.0.app/Contents/Resources/Java/libraries/ButtonEvent/ButtonEvent.h:40: error: 'byte' does not name a type
/Applications/Arduino 1.0.app/Contents/Resources/Java/libraries/ButtonEvent/ButtonEvent.h:60: error: 'byte' has not been declared


The 1.0 version has several things changed
- Wprogram.h ==>  Arduino.h
- byte ==> uint8_t

or use 0.22 ...
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Go Up