LoginSignup
0
0

備忘 Port busy arduinoとprocessing

Last updated at Posted at 2024-02-23

arduino IDEでスケッチしながら、processingにシリアル通信しようとしたらPort busyエラーが出た。

5時間くらい格闘した。

原因

arduinoを接続しているポートを、arduino IDEが占有していることが原因

対処

arduino IDEを閉じる

サンプルコード

=== arduino ===
void setup() {
    Serial.begin(9600);
}

int c;
void loop() {
    Serial.print(c++);
    delay(1000);
}

arduinoにスケッチを書き込んだら
arduino IDEを閉じる!

=== processing ===

import processing.serial.*;
Serial port;

void setup(){
    port=new Serial(this,"COM5",9600);
}
void draw(){
    if(port.available()>1){
        println(port.readString());
    }
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0