Python到Arduino Issu

2024-09-27 00:15:26 发布

您现在位置:Python中文网/ 问答频道 /正文

我目前正在做一个项目,由于某些原因,Python代码无法与Arduino板正常通信。我将非常感谢任何帮助,因为我已经尝试了一切,但他们都失败了。在

代码

#include <LiquidCrystal.h>
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(13,12,11,10,9,8);

void setup() {
  // set up the LCD's number of columns and rows: 
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("Hello World");
}

void loop() {
  // scroll 13 positions (string length) to the left 
  // to move it offscreen left:
  for (int positionCounter = 0; positionCounter < 13; positionCounter++) {
    // scroll one position left:
    lcd.scrollDisplayLeft(); 
    // wait a bit:
    delay(500);
  }
}

python to arduino serial read & write

^{pr2}$

Tags: oftheto项目代码lcdinclude原因

热门问题