eBoard ①⑧⑨
Written for SIA 2017/2018
eagle_HelpMot.h
Go to the documentation of this file.
1 #ifndef EAGLE_EBOARD_HELPLIB_HELPMOT
2  #define EAGLE_EBOARD_HELPLIB_HELPMOT
3 
12 //=====================================================================================================================================================
13 // Motor support
14 //=====================================================================================================================================================
15 
16  //-------------------------------------------------------------------------------------------------------------------------------------------------
17  // set speed
18  //-------------------------------------------------------------------------------------------------------------------------------------------------
19 
24  inline void set_motor_speed(optVAL_t spe);
25 
26  //-------------------------------------------------------------------------------------------------------------------------------------------------
27  // set angle
28  //-------------------------------------------------------------------------------------------------------------------------------------------------
29 
34  inline void set_steer_angle(optVAL_t ang);
35 
37  inline void set_motor_speed(optVAL_t spe){
38  if(spe < 0 || spe > 180) return;
39  mainMotor.write(spe);
40  }
41  inline void set_steer_angle(optVAL_t ang){
42  if(ang < 0 || ang > 180) return;
43  steerMotor.write(ang);
44  }
45 
47 #endif
Servo steerMotor
Definition: eBoard.h:651
void write(int value)
sets angle or pulse width of the Servo
void set_steer_angle(optVAL_t ang)
sets the angle of the steering (data pin: EBOARD_HELPCAR_STEER) motor
void set_motor_speed(optVAL_t spe)
sets the speed of the main (data pin: EBOARD_HELPCAR_MAIN) motor
int optVAL_t
Definition: eBoard.h:137
Servo mainMotor
Definition: eBoard.h:651