Maker Faire - May 17, 2014
Presented by Don Coleman / @doncoleman
#include <SoftwareSerial.h>
#define RxD 6
#define TxD 7
SoftwareSerial bluetooth(RxD,TxD);
int counter = 0;
void setup() {
Serial.begin(9600);
bluetooth.begin(9600);
Serial.println("Bluetooth Counter\n");
}
void loop() {
Serial.println(counter);
bluetooth.println(counter);
counter++;
delay(1000);
}
aka Bluetooth Smart
but available hardware has "serial like" services
#include <SoftwareSerial.h>
// ...
SoftwareSerial bluetooth(RxD,TxD);
// ...
void loop() {
if (bluetooth.find("c")) {
red = bluetooth.parseInt();
green = bluetooth.parseInt();
blue = bluetooth.parseInt();
showColor(red, green, blue);
}
}
void showColor(int r, int g, int b) {
uint32_t color = strip.Color(r, g, b);
for (int i=0; i < strip.numPixels(); i++) {
strip.setPixelColor(i, color);
}
strip.show();
}
MAKE: PROJECTS Bluetooth Low Energy Lock
Don Coleman
Add Bluetooth to your Ardunio Project by Don Coleman
is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Based on a work at https://github.com/don/.../2014-05-17-makerfaire-bluetooth.