Go Down

Topic: SerialEvent with a bluetooth module (Read 95 times) previous topic - next topic

Slevin217

Hello,

I am trying to create an interrupt with the bluetooth module. I initialize a serial port with the bluetooth pins and it works, but it doesn't create a serialEvent. Did anybody know if it's possible with the arduino UNO board?

Thank you!

Robin2

#1
Jul 04, 2015, 05:17 pm Last Edit: Jul 04, 2015, 05:18 pm by Robin2
SerialEvent is NOT an interrupt - though I understand why you may think it is.

It is exactly the same as having the following code as the last thing in loop()

Code: [Select]
void loop() {

   // other stuff

   if (Serial.available() > 0) {
      mySerialEvent()
   }
}


and you can easily add that functionality - if you think it actually adds any value.

Have a look at the examples in serial input basics

...R

Slevin217

Ohh... Ok.
I thought that because when you recieve a message it calls automatically to another method.

So, thank you!

Go Up