Processing
リンク
ArduinoとProcessingのリンク(Firmata経由)
- http://playground.arduino.cc/interfacing/processing
チュートリアルの内容は1.5.1でないと動かない
- http://arduino.cc/forum/index.php?action=printpage;topic=121655.0
練習
アナログピン0につないだボリュームの通りに跳ねるボールが左右に動く
import processing.serial.*; import cc.arduino.*; Arduino arduino; int y=0; int dy=0; int g=1; void setup() { println(Arduino.list()); arduino = new Arduino(this, Arduino.list()[4], 57600); size(1024,400); background(204); } void draw() { int x=0; x=arduino.analogRead(0); dy+=g; y+=dy; if(y>height){ dy=-dy-1; } background(204); ellipse(x,y,50,50); }