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.
IR_sensors.h
- Committer:
- edmugu
- Date:
- 2019-03-26
- Revision:
- 0:7676da98b5c1
File content as of revision 0:7676da98b5c1:
#ifndef IR_sensors_H
#define IR_sensors_H
#include "mbed.h"
enum State {left = 0b100,
centerleft = 0b110,
center = 0b010,
centerright = 0b011,
right= 0b001,
undef0 = 0b000,
undef1 = 0b111,
undefx = 0b101
};
class IR_sensors {
public:
IR_sensors(
PinName pinleft,
PinName pincenter,
PinName pinright,
PinName ledleft,
PinName ledcenter,
PinName ledright
);
State state(void);
protected:
DigitalIn _pinleft;
DigitalIn _pincenter;
DigitalIn _pinright;
DigitalOut _ledleft;
DigitalOut _ledcenter;
DigitalOut _ledright;
State _state;
};
#endif