Is SerialEvent tutorial for real ?

Did anybody ever successfully used SerialEvent as presented in this tutorial?
Just asking.

Why would anybody use SerialEvent ?

UKHeliBob:
Why would anybody use SerialEvent ?

Why can't you follow the instruction and just answer the question?

I have used SerialEvent successfully, but then did not get too enthused by it and quit using it, since it makes code less portable as you can't use it with Serial on Leonardo-type boards.

dmjlambert:
I have used SerialEvent successfully, but then did not get too enthused by it and quit using it, since it makes code less portable as you can't use it with Serial on Leonardo-type boards.

Thanks.
Did you run the SerialEvent inside loop() as in the tutorial?
Reason I asked - the tutorial also states ( in comments) that SerialEvent is executed outside loop() as part of main () function.

And that conflicts with the tutorial code.

Well this is interesting. I am looking at this one:

I believe that has been updated since I last looked at it.

If I copy the code exactly as shown in the tutorial, it works on Uno and Leonardo.

If I comment out the call to the function from inside the loop:

// serialEvent(); //call the function

it works on Uno, but does not work on Leonardo. I think they added the call to the function because the main function of the Leonardo core does not call the serialEvent function but the core for Uno does. For the Uno, calling the function twice per loop is harmless. So the tutorial is now more universal/portable. I still don't know that I particularly like it, and perhaps it is not terribly useful.

Additional note: At one point I was interested in finding out exactly why it is not called from the Leonardo main function, and I analyzed and studied the crap out of it and figured it all out. I'm afraid this is going to sound lame, but I forgot the answer, Professor! I became uninterested in using serialEvent.

I still don't know that I particularly like it, and perhaps it is not terribly useful.

Indeed. I wish they had gone the attachInterrupt route, instead of an alternate polling routine. I added it to HardwareSerial and called it [NeoHWSerial](http:// GitHub - SlashDevin/NeoHWSerial: Arduino HardwareSerial with attachInterrupt for RX chars), if you'd be interested.

Cheers,
/dev

Thanks for all replies.
It cleared things up for me for now.
Appreciate that.
Cheers Vaclav