最終更新:2012-11-10 (土) 04:23:08 (4199d)
Arduino Leonardo
Top / Arduino Leonardo
http://arduino.cc/en/Main/ArduinoBoardLeonardo
概要
- Arduino Unoの後継機ではなく、その派生型。
- 表面実装パーツだけを使ったシンプルな回路で低価格化
マイコン
Arduino Unoとの違い
- 1個のマイコンでスケッチの実行およびUSB通信の両方を実現している
- リセット時にシリアルポートが再検出される
- シリアルポートを開いてもリセットされない
- キーボードとマウスのエミュレーション
- USBとシリアル通信の分離
- ピン機能の相違
デバイスディスクリプタ
Arduino Leonardoへのガイド
マウスにする
int full = 100; int radius = 100; int delay_msec = 2; int phase = 0; int x = radius; int y = 0; void setup() { } void loop() { ++phase; phase %= full; double th = 3.141592 * 2 * phase / full; int xx = radius * cos(th); int yy = radius * sin(th); Mouse.move(xx - x, yy - y, 0); x = xx; y = yy; delay(delay_msec); }