Raspberry Pi2 & openFrameworks TIPS

ofxRPiCameraVideoGrabber

Sampleをmakeすると

could not convert ‘ofGLProgrammableRenderer::TYPE’ from ‘const string {aka const std::basic_string<char>}’ to ‘std::shared_ptr<ofBaseRenderer>’ ofSetCurrentRenderer(ofGLProgrammableRenderer::TYPE);

とでる。

こちらを参考にmain.cppを以下に変更

int main{

ofGLESWindowSettings settings;

settings.width = 1280;

settings.height = 720;

settings.setGLESVersion(2);

ofCreateWindow(settings);

ofRunApp( new testApp());

}

でmake成功した

makeオプション指定を楽にする

makeする時にいちいち、オプション指定するのが面倒くさいので

cd
ls -a

で表示される

.profile

nano .profile

してnanoでオープンして

export MAKEFLAGS=-j4 PLATFORM_VARIANT=rpi2

と書き込むと

openFrameworksのExampleフォルダ等で

make

するだけで、コンパイルが走る!

GPIOの番号を表示

gpio readall

openFrameworksからgpioを使う場合は、wiringPiを使うようです。GPIOの番号は、Raspberry PiとwiringPiで割当が違うようで番号を調べてる中で、上記のコマンドを見つけました。

接続されているI2Cデバイスを探す

i2cdetect -y 1

addonの追加

addonフォルダにて

git clone 使いたいofxAddonのリポジトリURL

プロジェクトフォルダのaddons.makeにAddon名を記入

ofxAddon

debug

Program received signal SIGILL, Illegal instruction と出て起動時に止まってしまう問題。gdbで以下のコマンドを打つと取り敢えず回避できる。

handle SIGILL nostop
handle SIGINT nonstop

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です