serial interrupt with Arduino language

hello, I'm doing a program with Arduino MEGA requires the use of interrupts when Auduino receives a character on the serial port. In the language does not exist for now. There are libraries around with this feature? thanks

The standard Serial object already uses interrupts for received characters

Here are a few suggestions to solve your problem:

  1. Write your code to poll the serial port subsystem by calling Serial.available() instead of using interrupts. The existing ISR for the serial port will buffer some incoming characters if you are a little late polling the port.

  2. Use a timer ISR instead (e.g. using the MsTimer2 library) and call Serial.available() in the timer ISR. Again, the standard hardware serial ISR will buffer some characters between timer interrupts.

  3. Modify the existing code in HardwareSerial.h & .cpp to provide a facility for registering a callback function when a character is received, and call that function near the end of the serial receive ISR.

  4. Write your own driver code for the hardware serial port.

[EDIT: I didn’t know about serialEvent() when wrote that.]

Does serialEvent() ( do what you need?