Difference between revisions of "Tutorial:Arduino"

From MobiNetS
Jump to: navigation, search
Line 2: Line 2:
===Here we introduce Arduino===
===Here we introduce Arduino===
Arduino is a <u>convenient</u>,<u> flexible</u> and <u>easy-to-use</u> <u>open source</u> electronic prototyping platform that includes '''hardware''' (various models of arduino boards) and '''software''' (arduino IDE)
Arduino is a <u>convenient</u>,<u> flexible</u> and <u>easy-to-use</u> <u>open source</u> electronic prototyping platform that includes '''hardware''' (various models of arduino boards) and '''software''' (arduino IDE)
*[[https://www.arduino.cn/ Arduino中文社区]]
*Find more interesting thing,Click -> [[https://www.arduino.cn/ Arduino中文社区]]


===Hardware===
===Hardware===

Revision as of 20:13, 25 September 2019

Introduction to Arduino

Here we introduce Arduino

Arduino is a convenient, flexible and easy-to-use open source electronic prototyping platform that includes hardware (various models of arduino boards) and software (arduino IDE)

Hardware

all kinds of Arduino: File:Logo.png

Software

Arduino IDE:

Arduino 编程,只需要在特定的框架下编写代码(语法跟C语言类似)。 有两段代码结构:

  • setup() {

}

 所有需要初始化的代码,都可以放在setup()函数体中(例如lora发射参数的设置),这里面的代码只会执行一次,接着就进入loop()循环里面,一直重复执行
  • loop(){

}

 在这里面的代码一直会重复执行,除非Arduino板子断电。例如用传感器采集数据的代码,或者发送数据的代码都可以放在这里,以便周期性的发送数据

库文件

  • Arduino有许多现成的库文件,可以直接调用,不用再着力于底层开发,例如要使用Lora进行通信,只需要将Lora的库文件(RH_RF95.h)导入到Arduino IDE里面,使用库文件提供的API接口,就可以实现lora之间的相互通信
  • Arduino还能添加许多额外的传感器,用来感知环境的变化,并进行处理,再将数据通过无线通信的方式发送到网关。