arduino可以通过串口和计算机进行通讯,我们能看到arduino上面有几个LED,其中LED旁边标有RX、TX。
RX:接收
TX :发出
变量存在arduino的内存里面,变量值可以改变,变量名字不变。
创建一个变量:
int currentTemperature; //创建一个变量
int currentTemperature = 18; //给变量一个初始值
注意创建变量需要注意,规避关键字,保留的字。
看一个arduino简单的程序:
这个程序用来使arduino上面的LED_BUILTIN点亮,LED_BUILTIN是指每一种开发板内部设置的和LED串联的接口。
/*
Blink
Turns an LED on for one second, then off for one second, repeatedly.
Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
the correct LED pin independent of which board is used.
If you want to know what pin the on-board LED is connected to on your Arduino
model, check the Technical Specs of your board at:
https://www.ar