Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: rgb_sensor_buffer
Dependents: coffee_capsule_detection
detection.h
- Committer:
- bjblazkowicz
- Date:
- 2014-07-11
- Revision:
- 3:4eefc032a319
- Parent:
- 1:a6c13143b151
File content as of revision 3:4eefc032a319:
#ifndef __DETECTION_H_
#define __DETECTION_H__
#include <rgb_sensor_buffer.h>
#define RGB_VALUES (50)
struct Capsule {
const char* name;
double r, g, b;
};
class RGB_Detection {
public:
RGB_Detection(PinName red, PinName green, PinName blue, PinName adc);
~RGB_Detection(void);
const char *run(void);
protected:
int match_sample_to_capsule(TRGB& rgb_sample);
const Capsule *read_capsule(void);
RGB_SensorBuffer m_rgb;
Capsule const *m_last_capsule;
TRGB m_buffer[RGB_VALUES];
// private:
// static bool __callback(const TRGB &color);
// bool callback(const TRGB &color);
// static RGB_Detection *m_global;
};
#endif // __DETECTION_H__