1.7 / November 30, 2015
(4.0/5) (8)

توضیحات

BTduino 是利用手機藍芽裝置(Bluetooth)連接Arduino的應用程式。此程式現提供數字按鍵模式及遊戲控制器模。往後亦會加入PWM,各種感應器及按鍵配對等功能。使用者需連接藍芽接收裝置如HC06至Arduino。藍芽HC06連接Arduino的設置如下:
1. 藍芽VCC接Arduino 5v或3.3v(視乎所購買的裝置而定)
2. 藍芽GND接Arduino GND
3. 藍芽RXD接Arduino TX(Pin10)
4. 藍芽TXD接Arduino RX(Pin11)
// Arduino RX(Pin 11) connect to Bluethooth TX, Arduino TX(Pin10)connect to Bluethooth RX

Arduino 設定
/*
btduino2 - Terminal Mode - by David Chung
*/
#include <SoftwareSerial.h>

SoftwareSerial myBT(11, 10);
const int ledPin = 13;
String inCode = "";
boolean endCode = false;

void setup() {
Serial.begin(9600);
myBT.begin(9600);
pinMode(ledPin, OUTPUT);
inCode.reserve(50);
}

void loop() {
if (myBT.available()) {
char incomingChar = myBT.read();
if(incomingChar == ')'){
endCode = true;
} else {
inCode += incomingChar;
}
}

if (endCode){
int strEnd = inCode.indexOf(')');
String myString = inCode.substring(0, strEnd);

Serial.print("Incoming : ");
Serial.println(myString);

if(myString == "on"){
digitalWrite(ledPin, HIGH);
myBT.print("LED On");
}
if(myString == "off"){
digitalWrite(ledPin, LOW);
myBT.print("LED Off");
}

inCode = "";
endCode = false;
}
}


/*
btduino2 - GamePad Mode - by David Chung
*/
#include <SoftwareSerial.h>

SoftwareSerial myBT(11, 10);
const int ledPin = 13;
int incomingByte = 0;

void setup() {
Serial.begin(9600);
myBT.begin(9600);
pinMode(ledPin, OUTPUT);
}

void loop() {
if (myBT.available()) {
incomingByte = myBT.read();
Serial.println(char(incomingByte));
if(incomingByte == 'L'){
digitalWrite(ledPin, HIGH);
}
if(incomingByte == 'R'){
digitalWrite(ledPin, LOW);
}
}
}

/*
Slider Mode
*/
#include <SoftwareSerial.h>

SoftwareSerial myBT(11, 10);
const int ledPin = 13;
String inCode = "";

boolean endCode = false;

void setup() {
Serial.begin(9600);
myBT.begin(9600);
pinMode(ledPin, OUTPUT);
inCode.reserve(30);
}

void loop() {
if (myBT.available()) {
char incomingChar = myBT.read();
if(incomingChar == ')'){
endCode = true;
} else {
inCode += incomingChar;
}
}

if (endCode){
int comma1 = inCode.indexOf(',');
int comma2 = inCode.indexOf(',', comma1 + 1);
String Rs = inCode.substring(0, comma1);
String Gs = inCode.substring(comma1 + 1, comma2);
String Bs = inCode.substring(comma2 + 1);

Serial.print("inCode = ");
Serial.print(inCode);
Serial.print(" R = ");
Serial.print(Rs);
Serial.print(" G = ");
Serial.print(Gs);
Serial.print(" B = ");
Serial.println(Bs);

int R = Rs.toInt();
int G = Gs.toInt();
int B = Bs.toInt();

analogWrite(ledPin, R);

inCode = "";
endCode = false;
}
}


/*
btduino2 - Orientation Mode - by David Chung
*/
#include <SoftwareSerial.h>

SoftwareSerial myBT(11, 10);
const int ledPin = 13;
String inCode = "";
boolean endCode = false;

void setup() {
Serial.begin(9600);
myBT.begin(9600);
pinMode(ledPin, OUTPUT);
inCode.reserve(30);
}

void loop() {
if (myBT.available()) {
char incomingChar = myBT.read();
if(incomingChar == ')'){
endCode = true;
} else {
inCode += incomingChar;
}
}

if (endCode){
int comma1 = inCode.indexOf(',');
int comma2 = inCode.indexOf(',', comma1 + 1);
String As = inCode.substring(0, comma1);
String Ps = inCode.substring(comma1 + 1, comma2);
String Rs = inCode.substring(comma2 + 1);

Serial.print("inCode = ");
Serial.print(inCode);
Serial.print(" Azimuth = ");
Serial.print(As);
Serial.print(" Pitch = ");
Serial.print(Ps);
Serial.print(" Roll = ");
Serial.println(Rs);

int A = As.toInt();
int P = Ps.toInt();
int R = Rs.toInt();

inCode = "";
endCode = false;
}
}

BTduino Bluetoothdeviceis using a mobile phone (Bluetooth) connected to theArduinoapplication. This program now provides keypad mode and thegamecontroller module. Later will join PWM, various sensors andbuttonsmatching functions. Bluetooth user to be connected to thereceivingdevice, such as HC06 Arduino. HC06 Arduino Bluetoothconnectionsettings are as follows:
1. Bluetooth connection Arduino 5v VCC or 3.3v (depending onthepurchased device may be)
2. Bluetooth connection Arduino GND GND
3. RXD connected Bluetooth Arduino TX (Pin10)
4. TXD connected Bluetooth Arduino RX (Pin11)
// Arduino RX (Pin 11) connect to Bluethooth TX, Arduino TX (Pin10)connect to Bluethooth RX

Arduino set
/ *
  btduino2 - Terminal Mode - by David Chung
* /
#include & lt; SoftwareSerial.h & gt;

SoftwareSerial myBT (11, 10);
const int ledPin = 13;
String inCode = "";
boolean endCode = false;

void setup () {
  Serial.begin (9600);
  myBT.begin (9600);
  pinMode (ledPin, OUTPUT);
  inCode.reserve (50);
}

void loop () {
  if (myBT.available ()) {
    char incomingChar = myBT.read ();
    if (incomingChar == ')') {
      endCode = true;
    } Else {
      inCode + = incomingChar;
    }
  }

  if (endCode) {
    int strEnd = inCode.indexOf (')');
    String myString = inCode.substring(0,strEnd);

    Serial.print ("Incoming:");
    Serial.println (myString);
    
    if (myString == "on") {
      digitalWrite(ledPin,HIGH);
      myBT.print ("LED On");
    }
    if (myString == "off") {
      digitalWrite(ledPin,LOW);
      myBT.print ("LED Off");
    }
    
    inCode = "";
    endCode = false;
  }
}


/ *
  btduino2 - GamePad Mode - by David Chung
* /
#include & lt; SoftwareSerial.h & gt;

SoftwareSerial myBT (11, 10);
const int ledPin = 13;
int incomingByte = 0;

void setup () {
  Serial.begin (9600);
  myBT.begin (9600);
  pinMode (ledPin, OUTPUT);
}

void loop () {
  if (myBT.available ()) {
    incomingByte = myBT.read ();
    Serial.println (char (incomingByte));
    if (incomingByte == 'L') {
      digitalWrite(ledPin,HIGH);
    }
    if (incomingByte == 'R') {
      digitalWrite(ledPin,LOW);
    }
  }
}

/ *
  Slider Mode
* /
#include & lt; SoftwareSerial.h & gt;

SoftwareSerial myBT (11, 10);
const int ledPin = 13;
String inCode = "";

boolean endCode = false;

void setup () {
  Serial.begin (9600);
  myBT.begin (9600);
  pinMode (ledPin, OUTPUT);
  inCode.reserve (30);
}

void loop () {
  if (myBT.available ()) {
    char incomingChar = myBT.read ();
    if (incomingChar == ')') {
      endCode = true;
    } Else {
      inCode + = incomingChar;
    }
  }

  if (endCode) {
    int comma1 = inCode.indexOf (',');
    int comma2 = inCode.indexOf (',', comma1+1);
    String Rs = inCode.substring(0,comma1);
    String Gs = inCode.substring (comma1 +1,comma2);
    String Bs = inCode.substring (comma2+1);

    Serial.print ("inCode =");
    Serial.print (inCode);
    Serial.print ("R =");
    Serial.print (Rs);
    Serial.print ("G =");
    Serial.print (Gs);
    Serial.print ("B =");
    Serial.println (Bs);

    int R = Rs.toInt ();
    int G = Gs.toInt ();
    int B = Bs.toInt ();

    analogWrite (ledPin, R);
    
    inCode = "";
    endCode = false;
  }
}


/ *
  btduino2 - Orientation Mode - by David Chung
* /
#include & lt; SoftwareSerial.h & gt;

SoftwareSerial myBT (11, 10);
const int ledPin = 13;
String inCode = "";
boolean endCode = false;

void setup () {
  Serial.begin (9600);
  myBT.begin (9600);
  pinMode (ledPin, OUTPUT);
  inCode.reserve (30);
}

void loop () {
  if (myBT.available ()) {
    char incomingChar = myBT.read ();
    if (incomingChar == ')') {
      endCode = true;
    } Else {
      inCode + = incomingChar;
    }
  }

  if (endCode) {
    int comma1 = inCode.indexOf (',');
    int comma2 = inCode.indexOf (',', comma1+1);
    String As = inCode.substring(0,comma1);
    String Ps = inCode.substring (comma1 +1,comma2);
    String Rs = inCode.substring (comma2+1);

    Serial.print ("inCode =");
    Serial.print (inCode);
    Serial.print ("Azimuth =");
    Serial.print (As);
    Serial.print ("Pitch =");
    Serial.print (Ps);
    Serial.print ("Roll =");
    Serial.println (Rs);

    int A = As.toInt ();
    int P = Ps.toInt ();
    int R = Rs.toInt ();

    inCode = "";
    endCode = false;
  }
}

اطلاعات برنامه اندروید BTduino - Arduino - Bluetooth

  • نام برنامه
    BTduino - Arduino - Bluetooth
  • نام بسته
    appinventor.ai_davidcswx.BTduino2
  • تاریخ بروزرسانی
    November 30, 2015
  • حجم فایل
    Undefined
  • حداقل نسخه اندروید
    Android 1.6 and up
  • نسخه
    1.7
  • توسعه دهنده
    Chung Siu Wing, David
  • تعداد نصب
    1,000 - 5,000
  • قیمت
    رایگان
  • دسته بندی
    Tools
  • توسعه دهنده
  • Google Play Link

Chung Siu Wing, David نمایش ادامه...

BTduino - Arduino - Bluetooth 1.7 APK
Chung Siu Wing, David
BTduino 是利用手機藍芽裝置(Bluetooth)連接Arduino的應用程式。此程式現提供數字按鍵模式及遊戲控制器模。往後亦會加入PWM,各種感應器及按鍵配對等功能。使用者需連接藍芽接收裝置如HC06至Arduino。藍芽HC06連接Arduino的設置如下:1. 藍芽VCC接Arduino 5v或3.3v(視乎所購買的裝置而定)2. 藍芽GND接Arduino GND3. 藍芽RXD接Arduino TX(Pin10)4. 藍芽TXD接Arduino RX(Pin11)// Arduino RX(Pin 11) connect to Bluethooth TX, Arduino TX(Pin10)connect to Bluethooth RXArduino 設定/*btduino2 - Terminal Mode - by David Chung*/#include <SoftwareSerial.h>SoftwareSerial myBT(11, 10);const int ledPin = 13;String inCode = "";boolean endCode = false;void setup() {Serial.begin(9600);myBT.begin(9600);pinMode(ledPin, OUTPUT);inCode.reserve(50);}void loop() {if (myBT.available()) {char incomingChar = myBT.read();if(incomingChar == ')'){endCode = true;} else {inCode += incomingChar;}}if (endCode){int strEnd = inCode.indexOf(')');String myString = inCode.substring(0, strEnd);Serial.print("Incoming : ");Serial.println(myString);if(myString == "on"){digitalWrite(ledPin, HIGH);myBT.print("LED On");}if(myString == "off"){digitalWrite(ledPin, LOW);myBT.print("LED Off");}inCode = "";endCode = false;}}/*btduino2 - GamePad Mode - by David Chung*/#include <SoftwareSerial.h>SoftwareSerial myBT(11, 10);const int ledPin = 13;int incomingByte = 0;void setup() {Serial.begin(9600);myBT.begin(9600);pinMode(ledPin, OUTPUT);}void loop() {if (myBT.available()) {incomingByte = myBT.read();Serial.println(char(incomingByte));if(incomingByte == 'L'){digitalWrite(ledPin, HIGH);}if(incomingByte == 'R'){digitalWrite(ledPin, LOW);}}}/*Slider Mode*/#include <SoftwareSerial.h>SoftwareSerial myBT(11, 10);const int ledPin = 13;String inCode = "";boolean endCode = false;void setup() {Serial.begin(9600);myBT.begin(9600);pinMode(ledPin, OUTPUT);inCode.reserve(30);}void loop() {if (myBT.available()) {char incomingChar = myBT.read();if(incomingChar == ')'){endCode = true;} else {inCode += incomingChar;}}if (endCode){int comma1 = inCode.indexOf(',');int comma2 = inCode.indexOf(',', comma1 + 1);String Rs = inCode.substring(0, comma1);String Gs = inCode.substring(comma1 + 1, comma2);String Bs = inCode.substring(comma2 + 1);Serial.print("inCode = ");Serial.print(inCode);Serial.print(" R = ");Serial.print(Rs);Serial.print(" G = ");Serial.print(Gs);Serial.print(" B = ");Serial.println(Bs);int R = Rs.toInt();int G = Gs.toInt();int B = Bs.toInt();analogWrite(ledPin, R);inCode = "";endCode = false;}}/*btduino2 - Orientation Mode - by David Chung*/#include <SoftwareSerial.h>SoftwareSerial myBT(11, 10);const int ledPin = 13;String inCode = "";boolean endCode = false;void setup() {Serial.begin(9600);myBT.begin(9600);pinMode(ledPin, OUTPUT);inCode.reserve(30);}void loop() {if (myBT.available()) {char incomingChar = myBT.read();if(incomingChar == ')'){endCode = true;} else {inCode += incomingChar;}}if (endCode){int comma1 = inCode.indexOf(',');int comma2 = inCode.indexOf(',', comma1 + 1);String As = inCode.substring(0, comma1);String Ps = inCode.substring(comma1 + 1, comma2);String Rs = inCode.substring(comma2 + 1);Serial.print("inCode = ");Serial.print(inCode);Serial.print(" Azimuth = ");Serial.print(As);Serial.print(" Pitch = ");Serial.print(Ps);Serial.print(" Roll = ");Serial.println(Rs);int A = As.toInt();int P = Ps.toInt();int R = Rs.toInt();inCode = "";endCode = false;}}BTduino Bluetoothdeviceis using a mobile phone (Bluetooth) connected to theArduinoapplication. This program now provides keypad mode and thegamecontroller module. Later will join PWM, various sensors andbuttonsmatching functions. Bluetooth user to be connected to thereceivingdevice, such as HC06 Arduino. HC06 Arduino Bluetoothconnectionsettings are as follows:1. Bluetooth connection Arduino 5v VCC or 3.3v (depending onthepurchased device may be)2. Bluetooth connection Arduino GND GND3. RXD connected Bluetooth Arduino TX (Pin10)4. TXD connected Bluetooth Arduino RX (Pin11)// Arduino RX (Pin 11) connect to Bluethooth TX, Arduino TX (Pin10)connect to Bluethooth RXArduino set/ *  btduino2 - Terminal Mode - by David Chung* /#include & lt; SoftwareSerial.h & gt;SoftwareSerial myBT (11, 10);const int ledPin = 13;String inCode = "";boolean endCode = false;void setup () {  Serial.begin (9600);  myBT.begin (9600);  pinMode (ledPin, OUTPUT);  inCode.reserve (50);}void loop () {  if (myBT.available ()) {    char incomingChar = myBT.read ();    if (incomingChar == ')') {      endCode = true;    } Else {      inCode + = incomingChar;    }  }  if (endCode) {    int strEnd = inCode.indexOf (')');    String myString = inCode.substring(0,strEnd);    Serial.print ("Incoming:");    Serial.println (myString);        if (myString == "on") {      digitalWrite(ledPin,HIGH);      myBT.print ("LED On");    }    if (myString == "off") {      digitalWrite(ledPin,LOW);      myBT.print ("LED Off");    }        inCode = "";    endCode = false;  }}/ *  btduino2 - GamePad Mode - by David Chung* /#include & lt; SoftwareSerial.h & gt;SoftwareSerial myBT (11, 10);const int ledPin = 13;int incomingByte = 0;void setup () {  Serial.begin (9600);  myBT.begin (9600);  pinMode (ledPin, OUTPUT);}void loop () {  if (myBT.available ()) {    incomingByte = myBT.read ();    Serial.println (char (incomingByte));    if (incomingByte == 'L') {      digitalWrite(ledPin,HIGH);    }    if (incomingByte == 'R') {      digitalWrite(ledPin,LOW);    }  }}/ *  Slider Mode* /#include & lt; SoftwareSerial.h & gt;SoftwareSerial myBT (11, 10);const int ledPin = 13;String inCode = "";boolean endCode = false;void setup () {  Serial.begin (9600);  myBT.begin (9600);  pinMode (ledPin, OUTPUT);  inCode.reserve (30);}void loop () {  if (myBT.available ()) {    char incomingChar = myBT.read ();    if (incomingChar == ')') {      endCode = true;    } Else {      inCode + = incomingChar;    }  }  if (endCode) {    int comma1 = inCode.indexOf (',');    int comma2 = inCode.indexOf (',', comma1+1);    String Rs = inCode.substring(0,comma1);    String Gs = inCode.substring (comma1 +1,comma2);    String Bs = inCode.substring (comma2+1);    Serial.print ("inCode =");    Serial.print (inCode);    Serial.print ("R =");    Serial.print (Rs);    Serial.print ("G =");    Serial.print (Gs);    Serial.print ("B =");    Serial.println (Bs);    int R = Rs.toInt ();    int G = Gs.toInt ();    int B = Bs.toInt ();    analogWrite (ledPin, R);        inCode = "";    endCode = false;  }}/ *  btduino2 - Orientation Mode - by David Chung* /#include & lt; SoftwareSerial.h & gt;SoftwareSerial myBT (11, 10);const int ledPin = 13;String inCode = "";boolean endCode = false;void setup () {  Serial.begin (9600);  myBT.begin (9600);  pinMode (ledPin, OUTPUT);  inCode.reserve (30);}void loop () {  if (myBT.available ()) {    char incomingChar = myBT.read ();    if (incomingChar == ')') {      endCode = true;    } Else {      inCode + = incomingChar;    }  }  if (endCode) {    int comma1 = inCode.indexOf (',');    int comma2 = inCode.indexOf (',', comma1+1);    String As = inCode.substring(0,comma1);    String Ps = inCode.substring (comma1 +1,comma2);    String Rs = inCode.substring (comma2+1);    Serial.print ("inCode =");    Serial.print (inCode);    Serial.print ("Azimuth =");    Serial.print (As);    Serial.print ("Pitch =");    Serial.print (Ps);    Serial.print ("Roll =");    Serial.println (Rs);    int A = As.toInt ();    int P = Ps.toInt ();    int R = Rs.toInt ();    inCode = "";    endCode = false;  }}