Arduino勉強会/0B-Windowsへのinoのインストールと使い方
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
[[Arduino勉強会]]
#contents
2014/07/06からのアクセス回数 &counter;
** Windowsでinoを使う [#u0485a33]
[[Arduino勉強会/0A-MacOSXへのinoのインストールと使い方]]...
Windowsでinoを使う方法を調べて見ました。
** inoのインストール [#h6ffa2db]
Windowsでinoを使うには、以下のソフトが必要です。
- Arduino IDE Windows版
- cygwin
-- python27
-- python-setuptools
-- make
-- gcc-core
-- nano(テキストエディタ)
- picocom
以下では、Arduino IDEがインストールされ、動いているものと...
*** cygwinのインストール [#a0ebd3c9]
Cygwinの以下のサイトから、お使いのWindowsに合ったsetup-xx...
私は、古いXPにインストールしたので、setup-x86.exeをダウン...
cygwinのインストールで分かりにくいのが、このsetup-x86.exe...
以下の手順にそってインストールして下さい。
- ネットワークにアクセスできるようにして、ダウンロードし...
- Cygwin Net Release Setup Programの画面で、「次へ」ボタ...
- Choose A Download SourceでInstall from Internetを選択し...
- Select Root Install DirectoryとSelect Local Package Dir...
- Select Your Internet Connectionは、Direct Connectionを...
- Choose A Download Siteでは、http://ftp.iij.ad.jpを選択...
次が一番の難関のパッケージ選択画面です。
&ref(th_Select_packages.jpg);
- Select Packages画面から
-- Develをクリックし、makeとgcc-coreをクリックし、バージ...
-- Pythonをクリックし、pythonをクリックし、バージョン番号...
-- Editorsをクリックし、nanoのSkipをクリックし、バージョ...
- 最後に次にボタンを押すと、ダウンロードとインストールが...
- 完了ボタンをおして終わりです
*** Arduino IDEの移動 [#zf752caf]
準備ができたので、inoのインストールに進みます。
最初に、Arduino IDEをProgram FilesからC:\user\shareという...
移動します。
&ref(usr_share_arduino.png);
デスクトップのArduinoショートカットでArduino IDEが使える...
プロパティを以下の様に変更します。
&ref(arduino_short_cut.png);
*** inoのインストールとセットアップ [#vfcf94fb]
Cygwin Terminalのショートカットをダブルクリックし、Cygwin...
最初にArduino IDEへのシンボリックリンクを作成し、inoをイ...
#pre{{
$ ln -s /cygdrive/c/usr/share/Arduino/ /usr/share/arduino
$ easy_install ino
}}
*** picocomのインストール [#x0ffb594]
以下のpicocomのダウンロードサイトからpicocom-1.7.tar.gzを...
ユーザのディレクトリに保存します。
- [[picocomダウンロードサイト>https://code.google.com/p/p...
Cygwin Terminalで以下の様に展開し、makeコマンドを実行しま...
#pre{{
$ tar xzvf picocom-1.7.tar.gz
$ cd picocom-1.7
$ make
$ cp picocom.exe /usr/local/bin/
}}
** inoの動作確認 [#ka826631]
準備ができたので、inoの動作確認をします。
((inoの使い方については、[[Arduino勉強会/0A-MacOSXへのino...
#pre{{
$ mkdir sample
$ cd sample
$ ino init -t blink
$ ls -R
.:
lib src
./lib:
./src:
sketch.ino
$ ino build -m atmega328
Searching for Board description file (boards.txt) ... /us...
Searching for Arduino lib version file (version.txt) ... ...
Detecting Arduino software version ... 1.0.5 (1.0.5)
途中省略
Linking libarduino.a
Linking firmware.elf
Converting to firmware.hex
}}
上記のように無事firmware.hexが作成されればインストールは...
*** スケッチのアップロード [#b242d214]
inoは、LinuxやMacOSXなどのUNIXベースの環境を前提にしてい...
使えません。
その代わりにアップロードスクリプトを用意します。
テキストエディタnanoを使って以下のテキストを入力(コピー...
Ctrl-Oで書き込み、Ctrl-Xで終了します。
#pre{{
$ nano upload.sh
#!/bin/sh
MODEL=uno
MCU=atmega328p
PORT=COM3
SPEED=115200
case $# in
4) MODEL=$1; MCU=$2; SPEED=$3; PORT=$4 ;;
0) ;;
*) echo "Usage: upload.sh MODEL MCU SPEED PORT"; exit 1 ;;
esac
/usr/share/arduino/hardware/tools/avr/bin/avrdude \
-C /usr/share/arduino/hardware/tools/avr/etc/avrdude.conf \
-p $MCU -P $PORT -b $SPEED -c arduino \
-D -U "flash:w:.build/$MODEL/firmware.hex:i"
}}
作成したスクリプトを/usr/local/bin/コピーします。
#pre{{
$ chmod +x upload.sh
$ cp upload.sh /usr/local/bin/
}}
upload.shの引数は、C:\usr\share\Arduino\hardware\arduino...
調べて下さい。
私の持っているArduino Duemilanoveだと以下の様になっていま...
ここから、次の値をメモします。MODEL名には、list-modelsの...
- atmega328.build.mcu
- atmega328.upload.speed
#pre{{
#########################################################...
atmega328.name=Arduino Duemilanove w/ ATmega328
atmega328.upload.protocol=arduino
atmega328.upload.maximum_size=30720
atmega328.upload.speed=57600
atmega328.bootloader.low_fuses=0xFF
atmega328.bootloader.high_fuses=0xDA
atmega328.bootloader.extended_fuses=0x05
atmega328.bootloader.path=atmega
atmega328.bootloader.file=ATmegaBOOT_168_atmega328.hex
atmega328.bootloader.unlock_bits=0x3F
atmega328.bootloader.lock_bits=0x0F
atmega328.build.mcu=atmega328p
atmega328.build.f_cpu=16000000L
atmega328.build.core=arduino
atmega328.build.variant=standard
#########################################################...
}}
以下の様にしてアップロードします。
#pre{{
$ upload.sh atmega328 atmega328p 57600 COM10
$ upload.sh atmega328 atmega328p 57600 COM10
avrdude.exe: AVR device initialized and ready to accept i...
Reading | ###############################################...
avrdude.exe: Device signature = 0x1e950f
avrdude.exe: reading input file ".build/atmega328/firmwar...
avrdude.exe: writing flash (1076 bytes):
Writing | ###############################################...
avrdude.exe: 1076 bytes of flash written
avrdude.exe: verifying flash memory against .build/atmega...
avrdude.exe: load data flash data from input file .build/...
avrdude.exe: input file .build/atmega328/firmware.hex con...
avrdude.exe: reading on-chip flash data:
Reading | ###############################################...
avrdude.exe: verifying ...
avrdude.exe: 1076 bytes of flash verified
avrdude.exe done. Thank you.
}}
*** シリアルポートの使い方 [#e92c307a]
piccomは、Cygwinの/dev/ttySnを使って通信します。nには、CO...
COM10の場合には、/dev/ttyS9を指定します。
#pre{{
$ ino serial -p /dev/ttyS9
picocom v1.7
port is : /dev/ttyS9
flowcontrol : none
baudrate is : 9600
parity is : none
databits are : 8
escape is : C-a
local echo is : no
noinit is : no
noreset is : no
nolock is : yes
send_cmd is : sz -vv
receive_cmd is : rz -vv
imap is :
omap is :
emap is : crcrlf,delbs,
Terminal ready
0
999
1999
3000
4000
5000
6000
7001
8001
9001
10002
Thanks for using picocom
term_exitfunc: reset failed for dev /dev/pty0: Resource t...
}}
残念ながら、ttyのリセットで失敗するようで、終了後
#pre{{
$ stty echo
}}
で文字が表示できるようになりますが、改行キーの後にもどら...
ここは、今後の課題です。
** コメント [#cf9a8e39]
#vote(おもしろかった[2],そうでもない[0],わかりずらい[3])
皆様のご意見、ご希望をお待ちしております。勉強会で分から...
スパム防止に画像の文字列も入力してください。
- 九曜さんのマシンにインストールで気づいた点:python-setu...
#comment_kcaptcha
終了行:
[[Arduino勉強会]]
#contents
2014/07/06からのアクセス回数 &counter;
** Windowsでinoを使う [#u0485a33]
[[Arduino勉強会/0A-MacOSXへのinoのインストールと使い方]]...
Windowsでinoを使う方法を調べて見ました。
** inoのインストール [#h6ffa2db]
Windowsでinoを使うには、以下のソフトが必要です。
- Arduino IDE Windows版
- cygwin
-- python27
-- python-setuptools
-- make
-- gcc-core
-- nano(テキストエディタ)
- picocom
以下では、Arduino IDEがインストールされ、動いているものと...
*** cygwinのインストール [#a0ebd3c9]
Cygwinの以下のサイトから、お使いのWindowsに合ったsetup-xx...
私は、古いXPにインストールしたので、setup-x86.exeをダウン...
cygwinのインストールで分かりにくいのが、このsetup-x86.exe...
以下の手順にそってインストールして下さい。
- ネットワークにアクセスできるようにして、ダウンロードし...
- Cygwin Net Release Setup Programの画面で、「次へ」ボタ...
- Choose A Download SourceでInstall from Internetを選択し...
- Select Root Install DirectoryとSelect Local Package Dir...
- Select Your Internet Connectionは、Direct Connectionを...
- Choose A Download Siteでは、http://ftp.iij.ad.jpを選択...
次が一番の難関のパッケージ選択画面です。
&ref(th_Select_packages.jpg);
- Select Packages画面から
-- Develをクリックし、makeとgcc-coreをクリックし、バージ...
-- Pythonをクリックし、pythonをクリックし、バージョン番号...
-- Editorsをクリックし、nanoのSkipをクリックし、バージョ...
- 最後に次にボタンを押すと、ダウンロードとインストールが...
- 完了ボタンをおして終わりです
*** Arduino IDEの移動 [#zf752caf]
準備ができたので、inoのインストールに進みます。
最初に、Arduino IDEをProgram FilesからC:\user\shareという...
移動します。
&ref(usr_share_arduino.png);
デスクトップのArduinoショートカットでArduino IDEが使える...
プロパティを以下の様に変更します。
&ref(arduino_short_cut.png);
*** inoのインストールとセットアップ [#vfcf94fb]
Cygwin Terminalのショートカットをダブルクリックし、Cygwin...
最初にArduino IDEへのシンボリックリンクを作成し、inoをイ...
#pre{{
$ ln -s /cygdrive/c/usr/share/Arduino/ /usr/share/arduino
$ easy_install ino
}}
*** picocomのインストール [#x0ffb594]
以下のpicocomのダウンロードサイトからpicocom-1.7.tar.gzを...
ユーザのディレクトリに保存します。
- [[picocomダウンロードサイト>https://code.google.com/p/p...
Cygwin Terminalで以下の様に展開し、makeコマンドを実行しま...
#pre{{
$ tar xzvf picocom-1.7.tar.gz
$ cd picocom-1.7
$ make
$ cp picocom.exe /usr/local/bin/
}}
** inoの動作確認 [#ka826631]
準備ができたので、inoの動作確認をします。
((inoの使い方については、[[Arduino勉強会/0A-MacOSXへのino...
#pre{{
$ mkdir sample
$ cd sample
$ ino init -t blink
$ ls -R
.:
lib src
./lib:
./src:
sketch.ino
$ ino build -m atmega328
Searching for Board description file (boards.txt) ... /us...
Searching for Arduino lib version file (version.txt) ... ...
Detecting Arduino software version ... 1.0.5 (1.0.5)
途中省略
Linking libarduino.a
Linking firmware.elf
Converting to firmware.hex
}}
上記のように無事firmware.hexが作成されればインストールは...
*** スケッチのアップロード [#b242d214]
inoは、LinuxやMacOSXなどのUNIXベースの環境を前提にしてい...
使えません。
その代わりにアップロードスクリプトを用意します。
テキストエディタnanoを使って以下のテキストを入力(コピー...
Ctrl-Oで書き込み、Ctrl-Xで終了します。
#pre{{
$ nano upload.sh
#!/bin/sh
MODEL=uno
MCU=atmega328p
PORT=COM3
SPEED=115200
case $# in
4) MODEL=$1; MCU=$2; SPEED=$3; PORT=$4 ;;
0) ;;
*) echo "Usage: upload.sh MODEL MCU SPEED PORT"; exit 1 ;;
esac
/usr/share/arduino/hardware/tools/avr/bin/avrdude \
-C /usr/share/arduino/hardware/tools/avr/etc/avrdude.conf \
-p $MCU -P $PORT -b $SPEED -c arduino \
-D -U "flash:w:.build/$MODEL/firmware.hex:i"
}}
作成したスクリプトを/usr/local/bin/コピーします。
#pre{{
$ chmod +x upload.sh
$ cp upload.sh /usr/local/bin/
}}
upload.shの引数は、C:\usr\share\Arduino\hardware\arduino...
調べて下さい。
私の持っているArduino Duemilanoveだと以下の様になっていま...
ここから、次の値をメモします。MODEL名には、list-modelsの...
- atmega328.build.mcu
- atmega328.upload.speed
#pre{{
#########################################################...
atmega328.name=Arduino Duemilanove w/ ATmega328
atmega328.upload.protocol=arduino
atmega328.upload.maximum_size=30720
atmega328.upload.speed=57600
atmega328.bootloader.low_fuses=0xFF
atmega328.bootloader.high_fuses=0xDA
atmega328.bootloader.extended_fuses=0x05
atmega328.bootloader.path=atmega
atmega328.bootloader.file=ATmegaBOOT_168_atmega328.hex
atmega328.bootloader.unlock_bits=0x3F
atmega328.bootloader.lock_bits=0x0F
atmega328.build.mcu=atmega328p
atmega328.build.f_cpu=16000000L
atmega328.build.core=arduino
atmega328.build.variant=standard
#########################################################...
}}
以下の様にしてアップロードします。
#pre{{
$ upload.sh atmega328 atmega328p 57600 COM10
$ upload.sh atmega328 atmega328p 57600 COM10
avrdude.exe: AVR device initialized and ready to accept i...
Reading | ###############################################...
avrdude.exe: Device signature = 0x1e950f
avrdude.exe: reading input file ".build/atmega328/firmwar...
avrdude.exe: writing flash (1076 bytes):
Writing | ###############################################...
avrdude.exe: 1076 bytes of flash written
avrdude.exe: verifying flash memory against .build/atmega...
avrdude.exe: load data flash data from input file .build/...
avrdude.exe: input file .build/atmega328/firmware.hex con...
avrdude.exe: reading on-chip flash data:
Reading | ###############################################...
avrdude.exe: verifying ...
avrdude.exe: 1076 bytes of flash verified
avrdude.exe done. Thank you.
}}
*** シリアルポートの使い方 [#e92c307a]
piccomは、Cygwinの/dev/ttySnを使って通信します。nには、CO...
COM10の場合には、/dev/ttyS9を指定します。
#pre{{
$ ino serial -p /dev/ttyS9
picocom v1.7
port is : /dev/ttyS9
flowcontrol : none
baudrate is : 9600
parity is : none
databits are : 8
escape is : C-a
local echo is : no
noinit is : no
noreset is : no
nolock is : yes
send_cmd is : sz -vv
receive_cmd is : rz -vv
imap is :
omap is :
emap is : crcrlf,delbs,
Terminal ready
0
999
1999
3000
4000
5000
6000
7001
8001
9001
10002
Thanks for using picocom
term_exitfunc: reset failed for dev /dev/pty0: Resource t...
}}
残念ながら、ttyのリセットで失敗するようで、終了後
#pre{{
$ stty echo
}}
で文字が表示できるようになりますが、改行キーの後にもどら...
ここは、今後の課題です。
** コメント [#cf9a8e39]
#vote(おもしろかった[2],そうでもない[0],わかりずらい[3])
皆様のご意見、ご希望をお待ちしております。勉強会で分から...
スパム防止に画像の文字列も入力してください。
- 九曜さんのマシンにインストールで気づいた点:python-setu...
#comment_kcaptcha
ページ名:
SmartDoc