- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 arduino 项目的新手。我想请你帮忙。我从 (http://imall.iteadstudio.com/development-platform/arduino/shields/im130704001.html) 购买了 Arduino 的 BLE Shield。他们使用 Hm-10 蓝牙模块 (http://www.jnhuamao.cn/bluetooth.asp?ID=1) 制作了这个盾牌。 Itead Studio 没有使用此屏蔽的示例代码。我不知道如何对其进行编程或从 Arduino 发送 AT 命令。
我在数据表(ftp://imall.iteadstudio.com/Shield/IM130704001_ITEAD_BLE_Shield/DS_IM130704001_ITEAD_BLE_Shield.pdf)上阅读了“AT 命令”,并尝试使用此代码(http://arduino.cc/en/Reference/SoftwareSerial)将“AT 命令”从 arduino 发送到 BLE shield,但我只收到了返回的命令。
这里有人用过这个HM-10蓝牙模块吗?
我需要一些 arduino 草图寻求帮助!
最佳答案
#include <SoftwareSerial.h>
int led = 13;
int bluetoothTx = 2;
int bluetoothRx = 3;
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
int baudrate[8] ={4800,9600,14400,19200,28800,38400,57600,115200};
int i = 1;
void setup() {
Serial.begin(9600);
bluetooth.begin(9600);
while(!Serial){}
Serial.write("AT sent");
delay(500);
bluetooth.write("AT+NAME?");
delay(500);
while (bluetooth.available()) {
Serial.write(bluetooth.read());
}
delay(100);
Serial.println("");
bluetooth.write("AT+POWE3");
delay(500);
while(bluetooth.available())
{
Serial.write(bluetooth.read());
}
delay(100);
Serial.println("");
delay(500);
bluetooth.write("AT+CHAR?");
delay(500);
while (bluetooth.available()) {
Serial.write(bluetooth.read());
}
delay(100);
Serial.println("");
delay(500);
bluetooth.write("AT+NAMEFlightline"); //Check Status
delay(500);
while (bluetooth.available()) {
Serial.write((char)bluetooth.read());
}
Serial.println("");
bluetooth.write("AT+CHAR0x2901"); //add charicteristic
delay(500);
while (bluetooth.available()) {
Serial.write(bluetooth.read());
}
Serial.println("");
bluetooth.write("AT+RELI0");
delay(500);
while (bluetooth.available()) {
Serial.write(bluetooth.read());
}
Serial.println("");
bluetooth.write("AT+SHOW1");
delay(100);
while (bluetooth.available()) {
Serial.write(bluetooth.read());
}
Serial.println("");
pinMode(led,OUTPUT);
digitalWrite(led,HIGH);
}
void testAllBaudRates(){
for(int j=0; j<8; j++)
{
bluetooth.begin(baudrate[j]);
delay(100);
Serial.println("boud rate " + String(baudrate[j],DEC) +" i-> "+String(j,DEC));
// Serial.println("");
bluetooth.write("AT");
delay(500);
while (bluetooth.available()) {
Serial.write(bluetooth.read());
Serial.println();
}
delay(100);
}
}
// and now a few blinks of the LED,
// so that we know the program is running
void loop()
{
//Read from bluetooth and write to usb serial
while(bluetooth.available())
{
char toSend = (char)bluetooth.read();
if(toSend == 'x'){
digitalWrite(led,HIGH);
Serial.println("set high");
bluetooth.write("RXOK");
}else if(toSend == 'y'){
digitalWrite(led,LOW);
Serial.println("set low");
bluetooth.write("RXOK");
}
Serial.print(toSend);
}
//Read from usb serial to bluetooth
while(Serial.available())
{
char toSend = (char)Serial.read();
bluetooth.write(toSend);
Serial.print(toSend);
}
}
while(!Serial){}
AT sent
OK+Set:3
OK+Get:0x2901 <- this may be blank the first time you run it
OK+Set:Flightline
OK+Set:0x2901
OK+Set:0
OK+Set:1
[All the AT commands and a good explanation][1]
bluetooth.write("AT+CHAR?");
关于bluetooth - 如何使用基于HM-10蓝牙模块的BLE Shield?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19826749/
希望这不会太具体以保证问题结束。 我在校园里与一个研究小组合作,学习机器人技术和自动化。我目前的任务是学习 Arduino 电机扩展板的内部和外部,并将其与蓝牙扩展板结合起来。 我们正在使用 this
我正在尝试通过letsencrypt签署csr文件以获取签名证书并将其与Elasticsearch Shield一起使用。 创建 csr 文件: cd CONFIG_DIR/shield keytoo
我正在使用RedBear BLE Shield将数据连续流式传输到iOS。 我正在使用SDK中提供的聊天iOS应用程序来调试以下arduino代码: #include #include #incl
我是 arduino 项目的新手。我想请你帮忙。我从 (http://imall.iteadstudio.com/development-platform/arduino/shields/im1307
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwar
我想知道Shield UI图表的图表图例是否有交互性?例如可以使用图例隐藏数据系列吗?是否需要设置任何特殊属性? 最佳答案 是的。图表图例项可用于隐藏/显示图表上的数据系列。然而值得注意的是,如果一个
我想使用 Shield UI 创建一个包含两个条形图的条形图。 当我这样做时,它们并排显示,但我希望它们重叠。我不需要 Y 轴总值。例如,如果我使用面积图,它会这样做,但对于条形图则不会。 例如 th
我有一个带有隐藏列的shield-ui网格。一旦我修改数据源,即执行过滤器或进行排序,我的列大小就会变得困惑。 我的问题也可以在演示网站上看到 只需对网格进行排序就没有问题,然后隐藏一列并再次排序,您
我有一个带有 README.md 文件的 GitHub 存储库。我有一些 shields在我的标题下方,但它们是左对齐的,而不是居中。 ![example1](https://img.shields.
我一直在玩 Seeed Ethernet , SD , 和 TFT学习如何使用Arduino的盾牌。但是,我发现我不能同时使用这些屏蔽,因为它们三个都使用引脚 10 作为其 SS 引脚。 有没有办法以
NFL似乎在此处提供API服务:https://api.nfl.com/docs/getting-started/index.html 访问API端点需要获得OAuth2访问 token 。如果我没记
我正在使用 Shield UI 1.7.2 和 .Net Framework 3.5,一切都很好,但是当我将 .net 升级到 4.0 时,当我进行回发时,shield ui 图表有时会消失(图表 h
我将 WiFly shield 与 Arduino 一起使用,一切正常:我通过 USB 将我的 skecth 上传到 Arduino,我连接了一个 9V 电池,我断开了 USB,wifi 模块传输一切
是否可以使用 Arduino Wi-Fi 在客户端和服务器之间切换 shield ? 也就是说,在服务器模式和客户端模式之间即时切换 WiFiServer server(80); WiFiClient
我将 arduino mega 和 Arduino GSM Shield 与 Fyve(vodafone)- Sim 放在一起。从长远来看,我想添加一个 GPS,通过 GSM 模块将位置数据发送到 d
如何捕获应用程序数据包,包括 Hotspot Shield 和其他免费代理应用程序? 最佳答案 如果我理解您的问题,您正在寻找一种工具,可以让您捕获计算机上的网络数据包并检查它们。 您可以使用类似 W
我正在尝试使用Arduino wifi shied将数据从arduino上传到本地服务器。但是代码永远不会到达“已连接”线。我正在使用WAMP服务器。arduino wifishield的IP地址pi
我想知道是否有人可以提供任何使用 Shield UI 图表显示一段时间内水平滚动图表的建议/示例。 我乐于接受关于如何实现这一目标的建议,但希望看到实时(每秒或更低精度)滚动,通过频繁更新单个图形或者
我不太了解 Shield UI。文档对我来说非常模糊。我想要做的是让用下面的代码生成的表格变得可编辑。我已经尝试了一切,感觉我很接近但无济于事。有人可以指导我吗?此外,我还多次查看了他们的文档。
我有一个 Shield UI 可编辑网格,其中包含来自 MySql 数据库的数据。其中一个字段/列是日期。 我不知道如何格式化日期。 我将其作为列的一部分: {字段:“日期”,标题:“日期”,格式:“
我是一名优秀的程序员,十分优秀!