模拟输入引脚 - analogRead(A0);
adruino api查询 http://www.taichi-maker.com/homepage/reference-index/arduino-code-reference/
Tx是发送Rx是接收
如果想让arduino和esp8266进行通信可以把
arduino.tx :: esp.Rx
arduino.Rx :: esp.Tx
GPIO: 通用型输入输出接口

arduino 本身有一对串口 tx rx,然后这对串口被占用之后就需要使用软串口进行数据通信

软串口

  1. #include <SoftwareSerial.h>
  2. SoftwareSerial monitor(8, 9); // RX, TX
  3. int serial_putc( char c, struct __file * )
  4. {
  5. Serial.write( c );
  6. monitor.write( c );
  7. return c;
  8. }
  9. void printf_begin(void)
  10. {
  11. fdevopen( &serial_putc, 0 );
  12. }
  13. void setup() {
  14. Serial.begin(115200);
  15. monitor.begin(115200);
  16. printf_begin();
  17. }
  18. void loop(){
  19. printf("qwq\r\n");
  20. delay(1000);
  21. }

点灯

  1. void setup() {
  2. pinMode(13, OUTPUT);
  3. }
  4. void loop() {
  5. digitalWrite(13, HIGH);
  6. delay(1000);
  7. digitalWrite(13, LOW);
  8. delay(1000);
  9. }

vscode 拓展

安装0.45版本的arduino拓展,最新版的有问题
first u need to specify the path of your arduino, u can use command+, to set
安上了之后选择串口,选板子类型,运行
运行的时候会生成c_cpp….json, it helps you complete your code
it’ll generate $^&Code when you run it on windows, but on mac it does not exists
https://stackoom.com/question/2xot5
https://www.daimajiaoliu.com/daima/4e76f63dd900409
https://blog.csdn.net/sheng1522098487/article/details/79885501
https://wenku.baidu.com/view/43ba33c048d7c1c709a14581.html
https://www.arduino.cn/thread-18366-1-1.html
https://blog.csdn.net/RachelKong/article/details/77374620#include