PsiSwarm Library  0.8
Psiswarm Class Reference

#include <psiswarm.h>

Public Member Functions

void init (void)
 
float get_uptime (void)
 
void pause_user_code (float period)
 
void reset_encoders (void)
 
void debug (const char *format,...)
 

Detailed Description

Psiswarm Class The main class to define a robot

Example code for main.cpp:

#include "psiswarm.h"
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

§ debug()

void Psiswarm::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 325 of file psiswarm.cpp.

§ get_uptime()

float Psiswarm::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 339 of file psiswarm.cpp.

§ init()

void Psiswarm::init ( void  )

Main initialisation routine for the PsiSwarm robot

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

init()

Main initialisation routine for the PsiSwarm robot

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

Definition at line 169 of file psiswarm.cpp.

§ pause_user_code()

void Psiswarm::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 344 of file psiswarm.cpp.

§ reset_encoders()

void Psiswarm::reset_encoders ( void  )

Reset the wheel encoder counters

Definition at line 319 of file psiswarm.cpp.


The documentation for this class was generated from the following files: