Developer links
BreadMote
Giving your invention an app is now as easy as buttering bread. Simply import the BreadMote library into your hardware, add code to customize the app, and decide how to handle user input. That’s it! When BreadMote connects to your hardware you will see your app.
There are plenty of examples to get you started. BreadMote currently supports Wi-Fi and Bluetooth connections.
Why BreadMote?
Simple - you only code on your hardware. There’s no setup needed on the app itself!
Customizable - switches, time pickers, sliders, labels, and more! All displayed with names you pick and arranged how you specify
Dynamic - update, disable, add, or remove any component at any time
Troubleshooting Aid - display error messages directly on your phone rather than guess whats going on in your hardware
Installation & Documentation
You’ll need the app. It’s currently only on Android
Arduino - follow this guide to install the C++ library
ESP8266 - Using the Arduino IDE, follow this guide to install the C++ library
Documentation for the C++ library can be found here
Sample code
Blink a light, all from your phone!
#include <BreadMote.h>
#include <SoftwareSerial.h>
SoftwareSerial mySerial(4, 2); // RX, TX
//-----------------------------------------------------------------------
//--------------------- Boilerplate I/O methods -------------------------
//Read data from your Bluetooth / Wi-Fi radio
char BreadMote::readByte() {
return mySerial.read();
}
//Check to see if a byte is available to read from your Bluetooth / Wi-Fi radio
int BreadMote::getAvailableBytes() {
return mySerial.available();
}
//Writes to your Bluetooth / Wi-Fi radio
void BreadMote::write(char buf[], int len) {
mySerial.write(buf, len);
}
//-----------------------------------------------------------------------
//------ Customize interface and how app interaction are handled --------
void onClick() {
digitalWrite(LED_BUILTIN, HIGH);
delay(500);
digitalWrite(LED_BUILTIN, LOW);
}
void BreadMote::create() {
addButton("Blink", onClick);
}
//-----------------------------------------------------------------------
//--------------------------- Arduino methods ---------------------------
BreadMote breadMote;
void setup() {
Serial.begin(9600);
mySerial.begin(9600);
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
breadMote.read();//continuously called to read and write information to the remote
}
And here’s what the corresponding remote would look like:
Templates
Examples
Blink - Blink an LED on your hardware using the app
Print - Print all user interaction to your hardware’s serial monitor
Advanced - Log errors on Breadmote and disable parts of the UI dynamically
The future
There are currently plans to add:
- more hardware support
- an app for iOS
- more connection protocols (e.g. Wi-Fi Direct and Bluetooth Low Energy)
- more features (e.g. streaming audio and video from your hardware)
If you are interested in contributing, contact me at scottcypher14@gmail.com
Communication protocol
If you want to port BreadMote to another hardware, information about the protocol can be found here. Be sure to check out existing the existing libraries for example implementations.
Awesome projects
If your project uses BreadMote, I’d love to showcase it here! Contact me at scottcypher14@gmail.com