To see how to use this App click here. It is tutorial with a sample project. You can use the App for your own projects.
For this App to work you need to put a Arduino sketch in your Arduino device. To download the Arduino Sketch click here.
Learn various Arduino Commands by Chatting with Arduino. Program and set Arduino Pin functions by sending commands remotely without downloading code.
App is used to program (change pin settings) of Arduino remotely using Bluetooth. You do not need to download programs to change pin settings like pin mode. You can do it remotely using this app.
Its a great tool to learn Arduino in the most fun way by chatting with Arduino.
You can use the sample sketch given here. This sketch can be customized/changed to suit your needs, language and enhance your experience.
[Arduino Sketch]
/******Sketch for App*******/
#include <SoftwareSerial.h> // import the serial library
SoftwareSerial chat(10, 11); // RX, TX
void setup() {
chat.begin(9600);
}
void loop() {
if (chat.available()){
String readStr = "";
readStr=chat.readString();
//pinMode
if(readStr.startsWith("pinMode")){
String pin=readStr.substring(readStr.indexOf("(")+1,readStr.indexOf(","));
int pinNo=pin.toInt();
String mode=readStr.substring(readStr.indexOf(", ")+2,readStr.indexOf(")"));
if(mode=="INPUT"){
pinMode(pinNo, INPUT);}
if(mode=="OUTPUT"){
pinMode(pinNo, OUTPUT);}
if(mode=="INPUT_PULLUP"){
pinMode(pinNo, INPUT_PULLUP);}
chat.println("done");
}
//digitalWrite
if(readStr.startsWith("digitalWrite")){
String pin=readStr.substring(readStr.indexOf("(")+1,readStr.indexOf(","));
int pinNo=pin.toInt();
String value=readStr.substring(readStr.indexOf(", ")+2,readStr.indexOf(")"));
if(value=="HIGH"){
digitalWrite(pinNo, HIGH);}
if(value=="LOW"){
digitalWrite(pinNo, LOW);}
chat.println("done");
}
//digitalRead
if(readStr.startsWith("digitalRead")){
String pin=readStr.substring(readStr.indexOf("(")+1,readStr.indexOf(","));
int pinNo=pin.toInt();
int val=digitalRead(pinNo);
if(val==1){
chat.println("it's HIGH");}
if(val==0){
chat.println("it's LOW");}
}
//analogWrite
if(readStr.startsWith("analogWrite")){
String pin=readStr.substring(readStr.indexOf("(")+1,readStr.indexOf(","));
int pinNo=pin.toInt();
String val=readStr.substring(readStr.indexOf(", ")+2,readStr.indexOf(")"));
int value=val.toInt();
if(pinNo==10 || pinNo==11){
chat.println("You were trying to write on pins which are used by bluetooth RX/TX");// analog write/PWM on pins used by bluetooth can interrupt communication.
}else{
analogWrite(pinNo, value);
chat.println("done");
}
}
//tone
if(readStr.startsWith("tone")){
String pin=readStr.substring(readStr.indexOf("(")+1,readStr.indexOf(","));
int pinNo=pin.toInt();
String frq=readStr.substring(readStr.indexOf(", ")+2,readStr.indexOf(")"));
int frequency=frq.toInt();
String dur=readStr.substring(readStr.lastIndexOf(", ")+2,readStr.indexOf(")"));
int temp=dur.toInt();
long duration=temp*1000;
if(pinNo==10 || pinNo==11){
chat.println("You were trying to write on pins which are used by bluetooth RX/TX");// analog write/PWM on pins used by bluetooth can interrupt communication.
}else{
tone(pinNo, frequency, duration);
chat.println("done");
}
}
//analogRead
if(readStr.startsWith("analogRead")){
String pin=readStr.substring(readStr.indexOf("(")+1,readStr.indexOf(","));
int pinNo=pin.toInt();
int val=analogRead(pinNo);
chat.println("it's " + String(val));
}
}
}
/********end of sketch**********/
要查看如何使用此应用程序,请单击此处。这是教程有一个示例项目。您可以将该应用程序用于您自己的项目。
要使此应用程序正常工作,您需要在Arduino设备中放置Arduino草图。要下载Arduino Sketch,请点击此处。
通过与Arduino聊天了解各种Arduino命令。通过远程发送命令编程和设置Arduino Pin功能,无需下载代码。
应用程序用于使用蓝牙远程编程(更改引脚设置)Arduino。您无需下载程序即可更改引脚模式等引脚设置。您可以使用此应用程序远程执行此操作。
它是通过与Arduino聊天以最有趣的方式学习Arduino的好工具。
您可以使用此处给出的示例草图。可以自定义/更改此草图以满足您的需求,语言并增强您的体验。
[Arduino Sketch]
/ ******草图为App ******* /
#include&lt; SoftwareSerial.h&gt; //导入序列库
SoftwareSerial聊天(10,11); // RX,TX
void setup(){
chat.begin(9600);
}
void loop(){
if(chat.available()){
String readStr =“”;
readStr = chat.readString();
// pinMode
如果(readStr.startsWith( “pinMode”)){
String pin = readStr.substring(readStr.indexOf(“(”)+ 1,readStr.indexOf(“,”));
int pinNo = pin.toInt();
String mode = readStr.substring(readStr.indexOf(“,”)+ 2,readStr.indexOf(“)”));
如果(模式== “INPUT”){
pinMode(pinNo,INPUT);}
如果(模式== “OUTPUT”){
pinMode(pinNo,OUTPUT);}
如果(模式== “INPUT_PULLUP”){
pinMode(pinNo,INPUT_PULLUP);}
chat.println( “完成”);
}
// digitalWrite
如果(readStr.startsWith( “digitalWrite”)){
String pin = readStr.substring(readStr.indexOf(“(”)+ 1,readStr.indexOf(“,”));
int pinNo = pin.toInt();
String value = readStr.substring(readStr.indexOf(“,”)+ 2,readStr.indexOf(“)”));
如果(值== “HIGH”){
digitalWrite(pinNo,HIGH);}
如果(值== “LOW”){
digitalWrite(pinNo,LOW);}
chat.println( “完成”);
}
// digitalRead
如果(readStr.startsWith( “digitalRead”)){
String pin = readStr.substring(readStr.indexOf(“(”)+ 1,readStr.indexOf(“,”));
int pinNo = pin.toInt();
int val = digitalRead(pinNo);
如果(VAL == 1){
chat.println(“它很高”);}
如果(VAL == 0){
chat.println(“它很低”);}
}
// analogWrite
如果(readStr.startsWith( “analogWrite”)){
String pin = readStr.substring(readStr.indexOf(“(”)+ 1,readStr.indexOf(“,”));
int pinNo = pin.toInt();
String val = readStr.substring(readStr.indexOf(“,”)+ 2,readStr.indexOf(“)”));
int value = val.toInt();
if(pinNo == 10 || pinNo == 11){
chat.println(“你试图写入蓝牙RX / TX使用的引脚”); //蓝牙使用的引脚上的模拟写/ PWM可能会中断通信。
}其他{
analogWrite(pinNo,value);
chat.println( “完成”);
}
}
//音
如果(readStr.startsWith( “音”)){
String pin = readStr.substring(readStr.indexOf(“(”)+ 1,readStr.indexOf(“,”));
int pinNo = pin.toInt();
String frq = readStr.substring(readStr.indexOf(“,”)+ 2,readStr.indexOf(“)”));
int frequency = frq.toInt();
String dur = readStr.substring(readStr.lastIndexOf(“,”)+ 2,readStr.indexOf(“)”));
int temp = dur.toInt();
持续时间长=临时* 1000;
if(pinNo == 10 || pinNo == 11){
chat.println(“你试图写入蓝牙RX / TX使用的引脚”); //蓝牙使用的引脚上的模拟写/ PWM可能会中断通信。
}其他{
音调(pinNo,频率,持续时间);
chat.println( “完成”);
}
}
// analogRead
如果(readStr.startsWith( “analogRead”)){
String pin = readStr.substring(readStr.indexOf(“(”)+ 1,readStr.indexOf(“,”));
int pinNo = pin.toInt();
int val = analogRead(pinNo);
chat.println(“它是”+ String(val));
}
}
}
/ ********草图结束********** /