Last active
December 12, 2015 05:38
-
-
Save Lauszus/4722886 to your computer and use it in GitHub Desktop.
Help for Jay Subramaniam
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Example sketch for the RFCOMM/SPP Bluetooth library - developed by Kristian Lauszus | |
For more information visit my blog: http://blog.tkjelectronics.dk/ or | |
send me an e-mail: [email protected] | |
*/ | |
#include <Adafruit_MAX31855.h> | |
#include <SPP.h> | |
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 */ | |
SPP SerialBT(&Btd); // This will set the name to the defaults: "Arduino" and the pin to "1234" | |
//SPP SerialBT(&Btd, "Lauszus's Arduino","0000"); // You can also set the name and pin like so | |
Adafruit_MAX31855 thermocouple(3, 4, 5); | |
unsigned long lastTime; | |
void setup() { | |
Serial.begin(115200); | |
if (Usb.Init() == -1) { | |
Serial.print(F("\r\nOSC did not start")); | |
while(1); //halt | |
} | |
Serial.print(F("\r\nSPP Bluetooth Library Started")); | |
lastTime = millis(); | |
} | |
void loop() { | |
Usb.Task(); | |
if(SerialBT.connected) { | |
if ((millis() - lastTime) > 20) { | |
lastTime = millis(); | |
double data = thermocouple.readCelsius(); | |
SerialBT.printNumberln(data); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment