Finch
The Finch Educational Robot
Finch.h
00001 /* 
00002  * File:   Finch.h
00003  * Author: Tom Lauwers, BirdBrain Technologies (tlauwers@finchrobot.com)
00004  *
00005  * Contains the necessary function definitions to run a Finch in C++.
00006  * For full documentation, view the associated Finch.cpp
00007  * 
00008  * Created on May 23, 2011, 5:30 PM
00009  */
00010 
00011 #ifndef FINCH_H
00012 #define FINCH_H
00013 
00014 class Finch {
00015 public:
00016     Finch();
00017     virtual ~Finch();
00018     int connect();
00019     int disConnect();
00020     int setLED(int red, int green, int blue);
00021     int setMotors(int leftWheelSpeed, int rightWheelSpeed);
00022     int setMotors(int leftWheelSpeed, int rightWheelSpeed, int duration);
00023     int noteOn(int frequency);
00024     int noteOn(int frequency, int duration);
00025     int noteOff();
00026     double getTemperature();
00027     double* getAccelerations();
00028     int* getLightSensors();
00029     int* getObstacleSensors();
00030     int wasTapped();
00031     int wasShaken();
00032     int isObstacleLeftSide();
00033     int isObstacleRightSide();
00034     int getLeftLightSensor();
00035     int getRightLightSensor();
00036     double getXAcceleration();
00037     double getYAcceleration();
00038     double getZAcceleration();
00039     int isBeakUp();
00040     int isBeakDown();
00041     int isFinchLevel();
00042     int isFinchUpsideDown();
00043     int isRightWingDown();
00044     int isLeftWingDown();
00045     int counter();
00046     void keepAlive();  
00047     int finchRead(unsigned char bufToWrite[], unsigned char bufRead[]);
00048     int finchWrite(unsigned char bufToWrite[]);
00049     static unsigned __stdcall keepAliveEntryPoint(void * pThis)
00050       {
00051           Finch * pthX = (Finch*)pThis;   // Cast from void to Finch class pointer
00052           pthX->keepAlive();           // now call the true entry-point-function
00053 
00054           return 1;          // the thread exit code
00055       }
00056 private:
00057 
00058 };
00059 
00060 #endif  /* FINCH_H */
00061