Event-Based Library for Arduino

Although I am a relative newbie with Arduino, I used to program in Visual Basic. There are lots of events in VB. I have found these event driven routines you wrote extremely helpful for my project. I'd like to see a "serial data available" event for serial 1 or 1-4(mega) .

#include serTrigger.h
void setup(){
serTrigger.setser (Serial. event1);
serTrigger.setser (Serial1. event2);
//etc
}
void loop(){
serTrigger.loop();
}
void event1()}
read serial into variable, set a flag and return
}

Sure beats polling, or constantly calling a subroutine. It would sure clean up my code! I'd do it myself if I knew how. I had bad luck with wri
ting functions.
Jim