tested on Processing 2.1.2
- Run below the sketch after connect to Chibirobo using bluetooth.
- BluetoothでChibiroboとつないだあとに以下を実行してみよう。
Chibirobo robo;
void setup() {
robo = new Chibirobo(this, "/dev/cu.FireFly-A399-SPP", 9600);
robo.move(1000, 10000, 1000, 10000);
}
- Chibirobo will move forward
- Chibiroboが前に進むはずです
Chibirobo(PApplet that, String port, int baud);
// ex: Chibirobo robo = new Chibirobo(this, "/dev/cu.FireFly-A399-SPP", 9600);
- that: 通常、thisを入れれば良い
- port: 接続先
- baud: 通信速度
Chibirobo.move(int pulseHzL, int distanceL, int pulseHzR, int distanceR);
- pulseHzX: (多分)送ってるパルスの幅
- speed = 1/pulseHzX
- マイナスで後退
- distanceX: 進む量
Chibirobo.stop();
Chibirobo.exit();