Psi Swarm robot library version 0.9
Fork of PsiSwarmV9 by
Diff: colour.h
- Revision:
- 16:50686c07ad07
- Parent:
- 15:66be5ec52c3b
- Child:
- 17:bf614e28668f
--- a/colour.h Thu Jun 01 21:58:14 2017 +0000 +++ b/colour.h Thu Jun 01 23:02:32 2017 +0000 @@ -29,12 +29,43 @@ #define CONTROL 0x0F #define CDATA 0x14 +#define CS_C_BLACK 63 +#define CS_C_WHITE 802 +#define CS_R_BLACK 22 +#define CS_R_WHITE 244 +#define CS_G_BLACK 24 +#define CS_G_WHITE 297 +#define CS_B_BLACK 16 +#define CS_B_WHITE 232 + + /** * The Colour class contains the functions for reading the base-mounted and top-mounted I2C colour sensors (optional). + * + * Functions for use with the TAOS TCS34725 and TCS34721 I2C colour sensors + * + * Example: + * @code + * #include "psiswarm.h" + * + * int main() { + * init(); + * colour.start_colour_ticker(150); + while(1) { + pc.printf("Colour: %s\n",colour.get_colour_string(colour.get_detected_colour())); + wait(0.20); + } + * } + * @endcode */ class Colour { public: + /** Set integration time and gain of colour sensor to default values + * + */ + void colour_sensor_init(); + /** Set the gain of the base colour sensor * * @param gain The gain value for the sensor @@ -100,6 +131,11 @@ */ void start_colour_ticker(int period_ms); + /** Stops the polling ticker + * + */ + void stop_colour_ticker(void); + void IF_colour_ticker_start();