基本クラス

Dependents:   300_PS3com Quadrifoglio_PS3COM

Committer:
piroro4560
Date:
Thu Jun 23 15:01:48 2022 +0000
Revision:
4:c9ef83cbe905
Parent:
3:9b1aefdd251a
delete PS3_COM; delete OmniWheel

Who changed what in which revision?

UserRevisionLine numberNew contents of line
piroro4560 0:e2da5742a718 1 #include "Master.h"
piroro4560 0:e2da5742a718 2
piroro4560 0:e2da5742a718 3 Master::Master() :
piroro4560 0:e2da5742a718 4 pc(USBTX, USBRX, 115200)
piroro4560 3:9b1aefdd251a 5 ,shot(Pin_Kicker)
piroro4560 3:9b1aefdd251a 6 ,drib(Pin_Dribbler)
piroro4560 0:e2da5742a718 7 {
piroro4560 1:60319e61775d 8 motor[0] = new KohiMD(Pin_motor_0);
piroro4560 1:60319e61775d 9 motor[1] = new KohiMD(Pin_motor_1);
piroro4560 1:60319e61775d 10 motor[2] = new KohiMD(Pin_motor_2);
piroro4560 1:60319e61775d 11 motor[3] = new KohiMD(Pin_motor_3);
piroro4560 4:c9ef83cbe905 12 shot.setkickperiod(Kicker_Period);
piroro4560 4:c9ef83cbe905 13 shot.setoutputtime(Kicker_OutPutTime);
piroro4560 0:e2da5742a718 14 drib.setspeed(0.0);
piroro4560 0:e2da5742a718 15 }
piroro4560 0:e2da5742a718 16
piroro4560 0:e2da5742a718 17 void Master::Shot()
piroro4560 0:e2da5742a718 18 {
piroro4560 0:e2da5742a718 19 shot.outPut();
piroro4560 0:e2da5742a718 20 }
piroro4560 2:9d9681465f4a 21
piroro4560 0:e2da5742a718 22 void Master::Dribble(float power)
piroro4560 0:e2da5742a718 23 {
piroro4560 0:e2da5742a718 24 drib.setspeed(power);
piroro4560 0:e2da5742a718 25 }
piroro4560 2:9d9681465f4a 26
piroro4560 0:e2da5742a718 27 void Master::SetValueMotor(int num, double val)
piroro4560 0:e2da5742a718 28 {
piroro4560 0:e2da5742a718 29 motor[num]->setSpeed(val);
piroro4560 0:e2da5742a718 30 }