You are not logged in.

#1 FatBeard HM-10 Arduino Sketch » Sketch » 2017-08-05 16:30:22

hammer5858
Replies: 0

Here is the sketch that goes along with the FatBeard HM-10 app from iOS.
Buy the BLE module here cool

#include <SoftwareSerial.h>
#define LED_PIN 13

SoftwareSerial mySerial(0, 1); // RX, TX

void setup() {
Serial.begin(9600);
mySerial.begin(9600);
}
void loop() {
int c;
if (mySerial.available()) {
c = mySerial.read();
Serial.println("Got input:");
if (c == 1)
{
Serial.println(" off");
digitalWrite(LED_PIN, LOW);

}
if (c == 2)
{
Serial.println(" pulse");
digitalWrite(LED_PIN, HIGH);
delay(500);
digitalWrite(LED_PIN, LOW);
}
if (c == 0)
{
Serial.println(" on");
digitalWrite(LED_PIN, HIGH);

}
}
}



Buy the BLE module here

Board footer

Powered by FluxBB