Ardunio进行ESP8266 01S开发版测试 入门第一课

硬件准备:
1:USB转TTL下载器一个(图1);
2:ESP8266 01S 模块一个,由安信可公司开发(图2);
图1

图2
图3
软件环境:Arduino IDE环境。
软件开发环境很重要,我们需要用到很多SDK。我们暂时做不到对每一个设备的驱动都很了解,但是有了SDK,我们可以对模块进行二次开发等工作。完成更高一级的业务流程。
需要加载esp8266库文件(图5),并在文件->首选项(图4)中添加如下地址,用来下载esp8266的arduino库文件:
http://arduino.esp8266.com/stable/package_esp8266com_index.json

图4
到这里我们的基础环境就编辑好了。
下面我们写一段简单的代码:
这段代码有程序的初始化,有程序的运行过程,两段。

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial.println();
  Serial.print("connecting to ");
  Serial.println();
  Serial.print(Serial);
  Serial.println();
  if(!Serial) {
    // wait for serial port to connect. Needed for native USB
    Serial.print("Serial isnot connected 串口还没有连接上了");
  }
  else{ 
    Serial.print("Serial connected串口已经连接上");
    }
    
pinMode(LED_BUILTIN, OUTPUT);     // Initialize the LED_BUILTIN pin as an output
}

void loop() {
  // put your main code here, to run repeatedly:
 digitalWrite(LED_BUILTIN, LOW);   // Turn the LED on (Note that LOW is the voltage level
  // but actually the LED is on; this is because
  // it is active low on the ESP-01)
  delay(1000);                      // Wait for a second
  digitalWrite(LED_BUILTIN, HIGH);  // Turn the LED off by making the voltage HIGH
  delay(2000); 
  

}

学无止境,记录点滴的开发经验。转行,兴趣都不容易,欢迎喜欢开发,喜欢DIY的朋友。

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值