- 追加された行はこの色です。
- 削除された行はこの色です。
[[FrontPage]]
*概要 [#y19e7acd]
-Arduino Uno R3を動かす方法
*ライブラリの追加 [#g1a37e09]
**Ubuntu 13.04 [#uee1695c]
-~/sketch/library/にライブラリを置いて,arduino IDEを再起動する.
*サンプル集 [#gaf02ad5]
-[[github>https://github.com/hamko/sample/tree/master/arduino]]
-フォルダ内にlibraryというフォルダがある場合は,その中に入っているライブラリをインストールしてください.
*ピンアサイン [#ua2dd91d]
&ref(./arduino_uno_pin_assign.png,50%);
*環境開発設定 [#b20b125d]
**Ubuntu 13.04 [#ydbe4dc8]
-未接続状態で
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get -y update
sudo apt-get -y install oracle-java7-installer
sudo apt-get -y install arduino arduino-core
-Arduinoを接続して
sudo chmod a+rw /dev/ttyACM0
-動作確認
--Arduino IDE起動
arduino
--コードを書く場所に以下を記述
int led = 13;
void setup(){
pinMode(led,OUTPUT);
}
void loop(){
digitalWrite(led, HIGH);
delay(1000);
digitalWrite(led, LOW);
delay(1000);
}
--Verifyを押す
--Uploadを押す
--基板上のLが1秒ごとに光っていることを確認
*Sample [#p4e0abff]
**[[LEDチカチカ>https://github.com/hamko/sample/tree/master/arduino/led_tikatika]] [#fd48d532]
-オンボードをチカチカさせる.
**[[シリアル通信>https://github.com/hamko/sample/tree/master/arduino/serial_io]] [#g2003f54]
-シリアルIO
**[[タイマ割り込み>https://github.com/hamko/sample/tree/master/arduino/timer]] [#w61a33fd]
-library: MsTimer2
**[[シリアル通信をprintfで行う>https://github.com/hamko/sample/tree/master/arduino/serial_printf]] [#i7fb40e7]
**時間取得 [#wc88ee5d]
unsigned long ms, us;
ms = millis(); // Arduino をリセットしてからの時間(ミリ秒)
us = micros(); // Arduino をリセットしてからの時間(マイクロ秒)