Ardunio学习笔记(1)
配置Arduino IDE
Arduino采用串口下载代码存储到内部的 flash 中
那也就是我们将程序烧录到Arduino中,一共需要三步
- 选择好对应的例程
- 选择Arduino开发板型号(工具-开发板)
- 配置Arduino开发板的下载口 (工具——端口)
保存项目:Ctrl+s my_first_sketch 保存在Ardunio文件夹下
参考:https://blog.csdn.net/as480133937/article/details/105331315
MEGA2560 简介:https://wenku.baidu.com/view/73e888f85d0e7cd184254b35eefdc8d377ee14b8.html
https://blog.csdn.net/wangpengqi/article/details/78554791
MEGA2560引脚表:
https://blog.csdn.net/qq_43419705/article/details/104962808
Arduino基本函数:https://wenku.baidu.com/view/a4ad30e63086bceb19e8b8f67c1cfad6195fe9c8.html?fixfr=l0yal4yUJ9FxtdMHK8fKZg%253D%253D&fr=income1-wk_go_search-search
Ardunino基本函数(官方):
http://www.taichi-maker.com/homepage/reference-index/arduino-code-reference/
点亮第一个LED:
https://www.jianshu.com/p/ff7affbdbff4
面包板的使用:https://www.bilibili.com/video/BV164411J7GE?p=13
输入上拉模式在按键未按下时处于高电平,当按键按下处于低电平
当接LED灯时,需要配置为输入上拉模式或者接上电阻,防止短路
布尔运算符:http://www.taichi-maker.com/homepage/reference-index/arduino-code-reference/boolean-operators/
数码管:https://www.bilibili.com/video/BV164411J7GE?p=21
AnalogWrite模拟输出来调节PWM,注意只有带~的管脚才能用AnalogWrite
PWM:https://www.bilibili.com/video/BV164411J7GE?p=27&spm_id_from=333.1007.top_right_bar_window_history.content.click
通过调节5V所占的时间,即占空比来调节LED亮度
AnalogRead模拟输入(滑动变阻器,DS18B20):http://www.taichi-maker.com/homepage/reference-index/arduino-code-reference/analogread/
模拟输入输出应用实例:http://www.taichi-maker.com/homepage/arduino-basic-tutorial-index/arduino-basic-tutorial-30/