***Arduino へRasPi経由で書き込みする方法 [#nd668f80] Raspberry Pi(A) + DV-Mega RPi Radio(single) ケースを含めて全て購入品。 &ref(pic-2016032101.jpg,,40%); RPIradioには送受信モジュールADF7021とArdiunoのチップATMEGA328が載っていて 必要に応じてファームウエアの書き込みをしなくてはならないが、RasPi用Radioを 装着のまま、Arduinoのファームウェア書き換えができる、と言うものが公開されている。 装着のまま、Arduinoのファームウェア書き換えができる方法が公開されている。 参考:http://wp.me/P73v26-eM +結線 コンデンサC45の内側とGPIOの7pinを緑のリードで結線する。 &ref(pic-20160321-151729.jpg,,60%); +RPi側の準備 sudo apt-get update sudo apt-get install git avrdude python-dev python-rpi.gpio git clone https://github.com/openenergymonitor/avrdude-rpi.git cd avrdude-rpi sudo cp autoreset /usr/bin sudo cp avrdude-autoreset /usr/bin sudo mv /usr/bin/avrdude /usr/bin/avrdude-original sudo ln -s /usr/bin/avrdude-autoreset /usr/bin/avrdude +書き込み &color(Red){''注意''};二回目以降書き込む場合、すでにser2netが起動していると /dev/ttyAMA0を使用しているので、必ず&color(Red){/etc/init.d/ser2net stop しておくこと};。 DVMEGA_HB_V223_UNO.cpp.hexを書き込む場合 avrdude -p m328p -c arduino -P /dev/ttyAMA0 -b 115200 -F -U flash:w:DVMEGA_HB_V223_UNO.cpp.hex -v 短くコマンドにした -- m328up.sh -- #!/bin/bash if test $1 <> "" ;then avrdude -p m328p -c arduino -P /dev/ttyAMA0 -b 115200 -F -U "flash:w:$1" -v fi echo "Usage: m328up.sh aabbcc.hex" #clear #comment #navi(日記) |