Skip to content

Instantly share code, notes, and snippets.

@Lauszus
Last active December 12, 2015 05:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lauszus/4722886 to your computer and use it in GitHub Desktop.
Save Lauszus/4722886 to your computer and use it in GitHub Desktop.
Help for Jay Subramaniam
/*
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: kristianl@tkjelectronics.com
*/
#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