5 ev3_speaker_set_volume ( 100 ) ;
9 const int8_t reverseValue = rotationalDirection ==
SPIN_RIGHT 16 ev3_speaker_play_tone ( NOTE_FS6, 100 ) ;
17 msg_f (
"Spin...", 2 ) ;
20 leftReverseValue = reverseValue ;
21 rightReverseValue = reverseValue * -1 ;
22 while ( ( leftWheel.
getCount () * leftReverseValue ) < ( angle / 0.64 ) ) {
23 leftWheel.
setPWM ( forward * leftReverseValue ) ;
24 rightWheel.
setPWM ( forward * rightReverseValue ) ;
35 ev3_speaker_play_tone ( NOTE_FS6, 100 ) ;
36 msg_f (
"Go...", 3 ) ;
39 while ( ( ( leftWheel.
getCount () + rightWheel.
getCount () ) / 2 ) < distance ) {
40 leftWheel.
setPWM ( forward ) ;
41 rightWheel.
setPWM ( forward ) ;
52 ev3_speaker_play_tone ( NOTE_FS6, 100 ) ;
53 msg_f (
"Go...", 3 ) ;
56 while ( ( ( leftWheel.
getCount () + rightWheel.
getCount () ) / 2 ) > ( -1 * distance ) ) {
57 leftWheel.
setPWM ( -1 * forward ) ;
58 rightWheel.
setPWM ( -1 * forward ) ;
void setBrake(bool brake)
void backStraight(int32_t, int32_t)
void msg_f(const char *str, int32_t line)
int32_t getCount(void) const
void spin(int32_t, bool, int32_t)
void goStraight(int32_t, int32_t)