1、基础 C 语言关键字ifif.elseforswitch casewhiledo. whilebreakcontinuereturngoto语法符号; -语句结束 -/ -行注释/* */ -段注释#define -宏定义#include -库文件定义数学运算符+ (加)- (减)x (乘)/ (除)= (赋值)% (模运算)比较运算符= (等于)!= (不等于 )(大于)= (大于等于)布尔运算符& (与)| (或)! (非)指针运算符*&位运算符& (按位与)| (按位或) (按位异或) (按位非) (按位右移)复合运算符+ (自增)- (自减)+= (加法赋值)-= (减法赋值)*= (
2、乘法赋值)/= (除法赋值)&= (位逻辑与赋值)|= (位逻辑或赋值)数据类型voidboolean - 布尔类型char - 字符类型unsigned char - 无符号字符类型byte - 字节类型int - 整数类型unsigned int - 无符号整数类型word - 长字类型long - 长整数类型unsigned long - 无符号长整数类型float - 浮点类型double - 双精度浮点类型string - 字符数组型Stringarray - 数组类型数据类型转换char()byte()int()word()long()float()单目操作数sizeof()Ard
3、uino 语言结构setup()loop()常量HIGH/LOWINPUT/OUTPUTtrue/false数字 IOpinMode()digitalWrite()digitalRead()模拟 IOanalogReference()analogRead()analogWrite()扩展 IOtone()noTone()shiftOut()shiftIn()pulseIn()时间函数millis()micros()delay()delayMicroseconds()数学函数min()max()abs()constrain()map()pow()sqrt()三角函数sin()cos()tan()随机数函数randomSeed()random()中断函数attachInterrupt()detachInterrupt()interrupts()noInterrupts()位和字节操作函数lowByte()highByte()bitRead()bitWrite()bitSet()bitClear()bit()串口收发函数Serial