Go Down

Topic: SerialEvent with a bluetooth module (Read 266 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
Two or three hours spent thinking and reading documentation solves most programming problems.

Slevin217

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

So, thank you!

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy