C++ Library for the PsiSwarm Robot - Version 0.8

Dependents:   PsiSwarm_V8_Blank_CPP Autonomia_RndmWlk

Fork of PsiSwarmV7_CPP by Psi Swarm Robot

Embed: (wiki syntax)

« Back to documentation index

Psiswarm Class Reference

Psiswarm Class Reference

Psiswarm Class The main class to define a robot. More...

#include <psiswarm.h>

Public Member Functions

void init (void)
 Main initialisation routine for the PsiSwarm robot.
float get_uptime (void)
 Get the uptime for the robot.
void pause_user_code (float period)
 Pause the user code for a defined amount of time.
void reset_encoders (void)
 Reset the wheel encoder counters.
void debug (const char *format,...)
 Send a string (in printf format) to the preferred debug stream, specified in settings.h [of overridden programmatically].

Detailed Description

Psiswarm Class The main class to define a robot.

Example code for main.cpp:

 #include "psiswarm.h"
 Psiswarm psi;
 char * program_name = "Example";
 char * author_name  = "Name";
 char * version_name = "0.8";
 void handle_switch_event(char switch_state){}
 void handle_user_serial_message(char * message, char length, char interface) {}
 int main(){
    psi.init();
    while(1) { //Do something!
    }
 }

Definition at line 98 of file psiswarm.h.


Member Function Documentation

void debug ( const char *  format,
  ... 
)

Send a string (in printf format) to the preferred debug stream, specified in settings.h [of overridden programmatically].

Parameters:
Thestring to send to output stream

Definition at line 327 of file psiswarm.cpp.

float get_uptime ( void   )

Get the uptime for the robot.

Returns:
The amount of time in seconds that the MBED has been active since last reset

Definition at line 341 of file psiswarm.cpp.

void init ( void   )

Main initialisation routine for the PsiSwarm robot.

init()

Set up the GPIO expansion ICs, launch demo mode if button is held

Main initialisation routine for the PsiSwarm robot

Set up the GPIO expansion ICs, launch demo mode if button is held

Definition at line 171 of file psiswarm.cpp.

void pause_user_code ( float  period )

Pause the user code for a defined amount of time.

Parameters:
Theamount of time in seconds to pause user code

Definition at line 346 of file psiswarm.cpp.

void reset_encoders ( void   )

Reset the wheel encoder counters.

Definition at line 321 of file psiswarm.cpp.