前面曾经介绍了这个软件SMeshStudio,这里简单介绍一下我的第一个测试程序,Blinky。
打开软件,按照图中所示,创建一个新的程序。
第二部:随便给你的应用程序起个名字,然后选择下一步,这个就不配图了,相当简单。
第三部:配置和选择,非常重要的一步。
第四步,想Arduino一样增加代码到固定的位置
// Do not remove the include below
#include "bluno_1.h"
void setup()
{
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}
void loop()
{
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}// Auto Added by "SMeshLink SMeshStudio"
看到了吗,是不是和Arduino的一模一样啊,不过不不一样的地方在这里。
左侧系统列出了与这个工程有关的所有源码了,对于程序猿来说是不是贼拉亲切啊。
第五步,编译下载
这个和Arduino是一模一样的,按钮都一模一样。链接号Bluno模块到电脑后,选择编译和上传,看看是不是小灯闪烁了。