Kamuycikap - SentenceDataBase

日々の勉強の記録を気分で書き綴るブログ

Ubuntu12へArduinoUnoの開発環境を準備

Arduinoの本家サイトに掲載されている方法では失敗

Install Arduino on Ubuntu Linuxへアクセスし、Ubuntuの項にあるインストール手順を実施してみたが、依存関係の問題でうまくインストール出来なかった。

"Ubuntu Software Center" settings or do the following:
Download the .debs for arduino, arduino-core, and librxtx-java into a clean directory from
http://packages.ubuntu.com/maverick-backports/librxtx-java
http://packages.ubuntu.com/maverick-backports/arduino-core
http://packages.ubuntu.com/maverick-backports/arduino
(go down to the part that says "Download {package-name}" and choose your architecture or "all")
cd to the directory you downloaded the .debs into and
sudo dpkg -i *.deb
you can delete the download directory if you'd like when you're done

海外サイトで有益な情報をゲット

Install the Arduino IDE in Ubuntu 12.04
このサイトで紹介されているコマンドを実施するとうまくいった。

$ sudo apt-get install gcc-avr avr-libc
$ sudo apt-get install openjdk-6-jre
$ sudo update-alternatives --config java
(select the correct JRE if you have more than one installed)
$ dmesg
 
-- snip --
[226470.727790] usb 1-1.1: new full-speed USB device number 6 using ehci_hcd
[226470.861077] cdc_acm 1-1.1:1.0: ttyACM0: USB ACM device
[226470.861654] usbcore: registered new interface driver cdc_acm
[226470.861659] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters

Arduino IDEをインストール

IDEは本家から圧縮ファイルをダウンロードして、適当なディレクトリに回答するだけでOK。
本家ArduinoのDownloadページにあるLinux 32bitをクリック。
すると[arduino-1.0.3-linux32.tgz]のダウンロードが始まるので、適当なディレクトリに保存して展開する。

ターミナルを起動し、圧縮ファイルを保存したディレクトリに移動して、下記のコマンドを実行すると、IDEが起動する。

$ ./arduino

Blinkサンプルを動かしてみた

無事に起動したIDEの上段に、テキストファイルのようなアイコンで「開く」ボタンが存在する。
それをクリックすると、沢山のサンプルスケッチが表示される。

blinkを選ぶと、サンプルコードが表示される。

ArduinoUno基板の13番Pin → LEDのアノード → 1Kオームの抵抗 → ArduinoUno基板のGND

の回路をブレッドボード上にさくっと作って実行したら・・・・ちゃんと動作した。