Description
When bluetooth connected, it has the value 1.
Auto connection when bluetooth connected.
Syntax
Boolean btConnected( )
Parameters
return value : 1 if bluetooth connected.
Usages
btConnected( )
Examples in arduino
#include "AppGosu.h"
AppGosu app;
void setup() {
app.start();
app.setDelayCmd(20); // max speed 20ms
myStart();
}
void loop() {
} // end of loop
//---------------------------------------------------------
void serialEvent() {
app.serialMessage();
EventLoop();
}
void EventLoop() {
if( app.btConnected()) { // for auto starting
myStart();
}
// user event code here
}
//---------------------------------------------------------
void myStart(void) {
// user starting code here
app.clearAll();
}
by AppGosu
-----------------------------------------
No comments:
Post a Comment