Aiko not really an event driven platform? Just a timer?

115 views
Skip to first unread message

flightrisk

unread,
Jan 19, 2011, 12:35:20 PM1/19/11
to Aiko distributed platform
I can definitely see some usefulness in some applications for this
library, but I think I am missing something important as it doesn't
seem at all what I thought it was. How is it any different than just
using multiple timers? I'm new to the Arduino and thought I saw that
you really only have one timer you can use and therefore Aiko can help
there. But copying the visual studio syntax of "addHandler" is very
misleading since it doesn't seem to work that way at all. Ex:

How is this:

Events.addHandler(blinkLed, 500)

void blinkLed() {
// set the pin state
}

any different from:

Timer1.Interval = 500
...

void Timer1_Tick() {
// set the pin state
}

Question 2. Can I do this with Aiko or do I need some other library
which is what event driven means to me:

No timing loop, just a main unit and then events that trigger the
program. I want to use a shield to play wave files in random patterns
and then respond to a sensor that monitors proximity.

{pseudo code}
void AnalogPin1_StateChange() {
if AnalogPin1.State > 3 feet
playwave(come closer)
else
playwave(perfect, don't move)
}

and this example for a button press:

void DigitalPin3_StateChange()
if button.down
...
elseif button.up
...

In other words, the main unit of the program is operating in some type
of "standby" mode, like a kiosk, and the program must then respond in
real-time to events like a button press or a sensor changing state.

Thanks!

Paul Szymkowiak

unread,
Jan 19, 2011, 6:48:47 PM1/19/11
to aiko-p...@googlegroups.com
Hi flightrisk,

Unless I'm misunderstanding your question, if you go back to basics, you'll see that Arduino is itself basically operates on a timing loop. You have setup as a first time, called once routine, and the Loop.

Aiko is built on top of this basic structure, and provides a useful infrastructure for managing communications between a number of devices and the Internet. It solves a number of problems in that space pretty well.

So, unless, you want to abandon Arduino all together, I think you're stuck with the timing loop. There is at least one RTOS that has been developed for the Atmel AVR chips so maybe that might offer another path for you?

Cheers,


Paul
 
Paul Szymkowiak


--
You received this message because you are subscribed to the Google Groups "Aiko distributed platform" group.
To post to this group, send email to aiko-p...@googlegroups.com.
To unsubscribe from this group, send email to aiko-platfor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/aiko-platform?hl=en.


Scott Penrose

unread,
Jan 19, 2011, 6:54:10 PM1/19/11
to aiko-p...@googlegroups.com
This is also true for many systems that are event driven.

For example, you might use event driven to run your GUI. But your GUI is not necessarily multi threaded. It may even be that behind the scenes is a message passer for X11 or similar that reads the messages, and calls the entry.

Even driven is just that - you attach code to an event. The event might be a time, or an IO, or in a GUI a mouse etc. But that does not mean they are multi tasking.

Scott
Reply all
Reply to author
Forward
0 new messages