1

だから私は実際にラズベリーパイカメラv1.3を使用して2つのモーターを実行するモータードライバーとラズベリーパイを接続しようとしていますが、gpioに関連する問題があるようです。

私はRaspbianを使っているので試してみました

sudo apt-get update
sudo apt-get upgrade

しかし、更新しても問題の解決に役立たないようで、gpio インターフェイスを更新しても問題は解決しません。

これは、カメラが何かを見つけたらすぐにボードの LED を点灯させるために使用しているコードです。

import processing.io.*; // use the GPIO library

// store the desired state of the LED in a variable
boolean ledOn = false;

void setup() {
  // set pin 17 as an output:
  GPIO.pinMode(17, GPIO.OUTPUT);
}

void draw() {
  if (ledOn == true) { // If the desired state is on, then:

    // turn the LED on:
    GPIO.digitalWrite(17, GPIO.HIGH);

    // and set the background red:
    background(255, 0, 0);
  }

  else { // otherwise:

    // turn the LED off:
    GPIO.digitalWrite(17, GPIO.LOW);

    // and set the background black:
    background(0, 0, 0);
  }
}

void mouseClicked() {
  // When the mouse is clicked, store the opposite of
  // ledOn into ledOn, which toggles ledOn:
  ledOn = !ledOn;
}

コードは正常にコンパイルされますが、次のエラーが返されます

/sys/class/gpio/gpio4/direction: No such file or directory

アップデート

オペレーティング システム全体を最初から再インストールすると、問題が解決するようです。

4

0 に答える 0