Arduino {code}racer API
... better know the details.

Functions

bool CodeRacer::stopped_at_min_distance ()
 Returns true if the racer was stopped at minimum distance. This set to false each time start_stop_at_min_distance() is called. More...
 
bool CodeRacer::is_driving ()
 Return true if the racer is driving - forward or backward. More...
 
unsigned long CodeRacer::turn_left_for_ms ()
 Returns the duration of time that is internally stored and used for turning the racer left. More...
 
unsigned long CodeRacer::turn_right_for_ms ()
 Returns the duration of time that is internally stored and used for turning the racer left. More...
 
void CodeRacer::set_inactive ()
 Sets the coderracer_active state to inactive. If start_stop() is used - the inactive mode will be entered. More...
 
void CodeRacer::set_active ()
 Sets the coderracer_active state to active. If start_stop() is used - the active mode will be entered. More...
 
bool CodeRacer::is_active ()
 Checks if coderracer_activ is set. More...
 

Detailed Description

Function Documentation

◆ stopped_at_min_distance()

bool CodeRacer::stopped_at_min_distance ( )

Returns true if the racer was stopped at minimum distance. This set to false each time start_stop_at_min_distance() is called.

Returns
True if stopped.

Definition at line 380 of file CodeRacer.cpp.

380  {
381  return(_coderacer_stopped_at_min_distance);
382 }

◆ is_driving()

bool CodeRacer::is_driving ( )

Return true if the racer is driving - forward or backward.

Returns
True if driving forward or backward

Definition at line 387 of file CodeRacer.cpp.

387  {
388  return(_drive);
389 }

◆ turn_left_for_ms()

unsigned long CodeRacer::turn_left_for_ms ( )

Returns the duration of time that is internally stored and used for turning the racer left.

Returns
Time to turn left in ms

Definition at line 394 of file CodeRacer.cpp.

394  {
395  return(_turn_left_for_ms);
396 }

◆ turn_right_for_ms()

unsigned long CodeRacer::turn_right_for_ms ( )

Returns the duration of time that is internally stored and used for turning the racer left.

Returns
Time to turn left in ms

Definition at line 401 of file CodeRacer.cpp.

401  {
402  return(_turn_right_for_ms);
403 }

◆ set_inactive()

void CodeRacer::set_inactive ( )

Sets the coderracer_active state to inactive. If start_stop() is used - the inactive mode will be entered.

Returns
nothing

Definition at line 408 of file CodeRacer.cpp.

408  {
409  coderracer_activ = false;
410 }

◆ set_active()

void CodeRacer::set_active ( )

Sets the coderracer_active state to active. If start_stop() is used - the active mode will be entered.

Returns
nothing

Definition at line 415 of file CodeRacer.cpp.

415  {
416  coderracer_activ = true;
417 }

◆ is_active()

bool CodeRacer::is_active ( )

Checks if coderracer_activ is set.

coderracer_activ is toggled each time the button is pressed. After power on coderracer_activ is set to False.

Returns
True id coderracer_activ is set - False if not.

Definition at line 424 of file CodeRacer.cpp.

424  {
425  return(coderracer_activ);
426 }