http://dev.unlimitedhand.com/unity/update.html
に従って、UnityやProcessing向けのインターフェースをダウンロードして動作を見てみた。ビリビリ系は試してない。
次はBluetoothの接続か。Unityで衝突に合わせてのビリビリか、、Photoreflectorの値がどんな意味あるのかまだよくわかっていないので、そっちも探求しないと。。。という感じでまだ初心者です。
まずスケッチを更新してみる
書き込んだスケッチはUH/examples/Serial_4Unity_4Processing
で、バージョンは0.33だった
ちょっとはまったこと。
- ボードのタイプをGenuino Unoに設定しないと avr/io.hが無いからコンパイルできない、とか言われる。7BotでArduino Dueの設定のままだった。上記のドキュメントにはちゃんと画像付きでガイドされてるのだけど、自分はそんなものは全然見てなくて、、(汗
シリアルモニターを起動する。
接続速度は115200baud
最初にヘルプメッセージが表示される。
コマンドは1文字
[HOW TO USE THIS ARDUINO CODE ON THE SERIAL MONITOR]
a: display the raw values of the acceleration and Gyro sensors
A: display the forearm angles
b: move the vibration motor for 0.3 sec
B: move the vibration motor for 1 sec
c: check the Photo-reflectors values
d: turn on the VibrationMotor
e: turn off the VibrationMotor
s: High Speed Mode
0~7:give the EMS(Electric Muscle Stimulation)
h: increase the voltage of the EMS., l: decrease the voltage of the EMS
m: increase the stimulation time of the EMS., n: decrease the stimulation time of the EMS
T: change the TEST mode
------------------------------------------------------------
Please input any charactor:
'a' 加速度センサーの値をダンプしてみる
2704+-3843+-14140+34.718+177+-98+166
SerialConnection.inoのコードを見ると
- 最初の3つは3軸(X,Y,Z)の加速度
- 次が温度
- 最後の3つは3軸のジャイロ
'a'を連打して加速度センサーの値の揺れを見てみる(動かしてはいない)
水平に置いたままの状態。3項めはZ軸の加速度で重力が検出されているっぽい。
1831+-4612+-14092+34.012+136+-256+198
1924+-4880+-14077+34.106+124+-103+195
1993+-4876+-14148+34.012+148+-86+180
1831+-4980+-14032+34.106+139+-127+197
1992+-4612+-14080+34.012+0+-253+200
'c'を連打してフォトセンサー(photo reflector)の値の揺れを見てみる(動かしてはいない)
8こある。
734_748_754_709_689_670_676_731
734_747_752_714_688_672_676_733
736_746_752_712_689_671_678_736
734_748_752_712_690_669_676_735
バイブレータを振動させてみる
'b'で0.3秒、'B'で1秒
# 'b' バイブレータを0.3秒振動させてみる
move the Vibration Motor. Time(sec):300
# 'B'
move the Vibration Motor. Time(sec):1000
'd' を入力するとバイブレータが振動を始め、'e'でストップする。画面表示は無い。
自動テストモード
'T'で自動テストモードに入る
Entering TEST MODE 1-3
-259 127 -109 745 764 760 717 687 664 669 718
-177 7 -108 745 766 760 718 687 666 668 718
-151 -28 -106 745 766 761 719 688 666 668 717
-146 -36 -105 749 767 764 721 692 666 670 719
-194 -76 -143 838 795 772 725 707 700 747 772
-157 -44 -143 750 768 764 724 692 665 680 725
142 -14 -177 897 964 966 965 893 790 627 726
174 23 -186 618 628 632 605 537 523 571 585
167 -28 -202 672 608 594 497 471 478 648 671
172 9 -210 672 758 795 779 756 703 605 650
187 -4 -195 646 786 816 813 787 827 615 670
-179 16 -187 766 765 777 790 782 809 707 705
161 27 -191 322 645 695 711 781 817 512 537
-175 87 -155 755 803 796 772 646 695 609 647
127 78 -154 547 714 656 402 348 346 509 553
147 15 -156 755 768 771 753 713 758 540 579
-169 27 -150 699 680 880 876 879 817 551 599
-175 -2 -153 761 728 736 798 739 701 580 624
-136 36 -167 796 842 872 913 925 907 541 609
-155 -9 -168 738 816 823 824 674 626 477 556
-167 -19 -168 731 805 827 830 684 637 490 571
179 -45 -154 635 684 743 762 652 599 566 684
-160 -24 -153 734 746 750 705 695 669 665 719
-162 -12 -151 731 746 749 711 697 672 672 716
Entering TEST MODE 4
Vol:6, EMS num: 0
Vol:6, EMS num: 1
Exit TEST MODE...
Vol:6, EMS num: 2
T: change the TEST mode
------------------------------------------------------------
Please input any charactor: