Skip to content

Instantly share code, notes, and snippets.

@notsobad
Last active December 16, 2018 03:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save notsobad/74cc5018af372a25fc547402797171da to your computer and use it in GitHub Desktop.
Save notsobad/74cc5018af372a25fc547402797171da to your computer and use it in GitHub Desktop.

关于串口(UART):

  1. 波特率表示每秒钟传输多少bit信息,如9600,则一bit约0.1ms,及100微秒左右,可以在示波器中看到
  2. 信息格式为0 + 8bit信息 + 奇偶校验位(可选),信息传输顺序为从低位到高位, 10000010 即为 01000001,即16进制的41,10进制的65,即字符A
  3. Arduino 只有一个串口Serial,想使用Serial1就要用SoftwareSerial
  4. 如果串口(0, 1)接了传感器,有可能会上传代码失败,这是把接的设备去掉即可
  5. 操作LCD设备,发现只有LiquidCrystal_I2C这个好用些,如果在循环在某一行中写数据,需要先clear,否则会重影

Arduino的编辑器不好用,可以使用vs code来做开发: https://www.dmcinfo.com/latest-thinking/blog/id/9484/arduino-programming-with-vscode

PMS 7003的库 https://github.com/fu-hsi/PMS

i2c LCD库 https://github.com/marcoschwartz/LiquidCrystal_I2C

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment