Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: OmniMove.h
- Revision:
- 9:91ce72a587ad
- Parent:
- 7:9b9d488ebcfd
- Child:
- 10:f902cac49aaf
--- a/OmniMove.h Fri Apr 23 09:01:44 2021 +0000 +++ b/OmniMove.h Fri Aug 27 06:33:57 2021 +0000 @@ -43,7 +43,7 @@ OmniMove mekanamu; //TickerやTimerのように宣言 int main(){ - float motor_output0,motor_output1,motor_output2,motor_output3;//それぞれのモータ出力変数を用意 + float motor_output[4];//それぞれのモータ出力変数(配列)を用意 mekanamu.setup(4,45); //車輪の個数、位置を設定(1度宣言すればいい) @@ -51,11 +51,8 @@ mekanamu.input_polar(0.5,90,0); //マシンの走行速度、進行方向、回転速度の入力 - //それぞれのモータ出力変数に値を入力 - motor_output0 = mekanamu.output_(0); - motor_output1 = mekanamu.output_(1); - motor_output2 = mekanamu.output_(2); - motor_output3 = mekanamu.output_(3); + //配列の先頭アドレスを渡すことでそれぞれのモータ出力変数に値を入力 + mekanamu.output(motor_output); } }