2017-05-09 3 views
0

私は、単純な二乗電圧を中断したいと私は共通のプログラム使用していました:ArduinoのLinuxのミント:エラー:「digitalPinToInterrupt」

const byte ledPin = 13; 
const byte interruptPin = 2; 
volatile byte state = LOW; 

void setup() { 
    pinMode(ledPin, OUTPUT); 
    pinMode(interruptPin, INPUT_PULLUP); 
    attachInterrupt(digitalPinToInterrupt(interruptPin), blink, CHANGE); 
} 

void loop() { 
    digitalWrite(ledPin, state); 
} 

void blink() { 
    state = !state; 
} 

をしかし、私はArduinoのソフトウェアでそれを確認したい場合、これはエラー:

interrupt.ino: In function ‘void setup()’: 
interrupt.ino:11:53: error: ‘digitalPinToInterrupt’ was not declared in this scope 

このコマンドを含むライブラリを追加しようとしましたが、問題が見つかりました。

arduino: 
    Installed: 2:1.0.5+dfsg2-4 
    Candidate: 2:1.0.5+dfsg2-4 
    Version table: 
*** 2:1.0.5+dfsg2-4 500 

そして私は、私は、これは、Linuxのミントでパッケージマネージャのバージョンであるhttps://www.arduino.cc からダウンロードしたIDEをインストールすることができませんでした:私は、LinuxのミントとArduinoのソフトウェアバージョンを使用しています です。

私の質問は、誰かがdigitalPinToInterrupt()を含むlibaryの場所を知っているかどうかです。 このバージョンのIDEにはlibaryマネージャーがありませんので、Linuxmint用の新しいバージョンのIDEを入手する方法を知っている人がいます。 あなたが

+0

[こちら](https://forum.arduino.cc/index.php?topic=370167.0)digitalPinToInterruptを使わずにピン番号を入力するだけです: 'attachInterrupt(interruptPin、blink、CHANGE) ;;それ以外の場合は最新のArduinoソフトウェアをインストールすると問題が解決するようです –

+0

[this](https://forum.arduino.cc/index.php?topic=370167.0)によれば、ピン番号はそのまま送信してもかまいませんマクロしかし、[this](https://github.com/arduino/Arduino/issues/3929)によれば、マクロは 'pins_arduino.h'で定義されています。とにかくこれは修正する必要があります最新バージョンでは。 –

+0

最新のArduinoソフトウェアをインストールすることはできません.githubで完全ではないため、pins_arduino.hを含めることはできません:https://github.com/agdl/Arduino/blob/e3351f6fb1717ce167a9c16781cf2c726f3d239e/hardware/arduino/avr/亜種/ ethernet/pins_arduino.h –

答えて

関連する問題