Updated example for RFCOMM/SPP

This commit is contained in:
Kristian Lauszus 2012-08-08 19:22:47 +02:00
parent d495336442
commit 5ce7cc2b55

View file

@ -4,11 +4,12 @@
send me an e-mail: kristianl@tkjelectronics.com send me an e-mail: kristianl@tkjelectronics.com
*/ */
#include <RFCOMM.h> #include <SPP.h>
USB Usb; USB Usb;
BTD Btd(&Usb); // You have to create the Bluetooth Dongle instance like so
/* You can create the instance of the class in two ways */ /* You can create the instance of the class in two ways */
RFCOMM SerialBT(&Usb); // This will set the name to the defaults: "Arduino" and the pin to "1234" SPP SerialBT(&Btd); // This will set the name to the defaults: "Arduino" and the pin to "1234"
//RFCOMM SerialBT(&Usb, "Lauszus' Arduino","0000"); // You can also set the name and pin like so //SPP SerialBT(&Btd, "Lauszus's Arduino","0000"); // You can also set the name and pin like so
boolean firstMessage = true; boolean firstMessage = true;
@ -34,5 +35,4 @@ void loop() {
} }
else else
firstMessage = true; firstMessage = true;
delay(5);
} }