C system()调用不';Arduino IDE串行监视器中的t显示
我有以下代码:C system()调用不';Arduino IDE串行监视器中的t显示,c,arduino,C,Arduino,我有以下代码: void setup() { // Configure the serial communication line at 9600 baud (bits per second.) Serial.begin(9600); delay(1000); system("ifconfig -a > /dev/ttyGSO"); // Configure the button's pin for input signals. pinMo
void setup() {
// Configure the serial communication line at 9600 baud (bits per second.)
Serial.begin(9600);
delay(1000);
system("ifconfig -a > /dev/ttyGSO");
// Configure the button's pin for input signals.
pinMode(pinButton, INPUT);
// Configure the LED's pin for output.
pinMode(pinLed, OUTPUT);
// Configure the angle sensor's pin for input.
pinMode(pinPotent, INPUT);
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
lcd.setRGB(colorR, colorG, colorB);
score = 5;
angle = analogRead(pinPotent);
}
系统(“ifconfig-a>/dev/ttyGSO”)
调用不会打印到Arduino IDE的串行监视器。但是,如果我直接在串行终端中输入ifconfig-a>/dev/ttyGSO
,它将按预期打印到监视器上。这是一个典型的错误,可能需要花费数小时才能找到
这一行有一个输入错误:
system("ifconfig -a > /dev/ttyGSO");
tty设备应以零而不是字母O
终止:
system("ifconfig -a > /dev/ttyGS0");
该死的。。。谢谢我很感激。