You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
657 B
C++
41 lines
657 B
C++
// TrafficLightCommand.h
|
|
|
|
#ifndef _TRAFFICLIGHTCOMMAND_h
|
|
#define _TRAFFICLIGHTCOMMAND_h
|
|
|
|
#if defined(ARDUINO) && ARDUINO >= 100
|
|
#include "arduino.h"
|
|
#else
|
|
#include "WProgram.h"
|
|
#endif
|
|
|
|
#include "CommandEncoder.h"
|
|
|
|
class TrafficLightCommand : private CommandEncoder
|
|
{
|
|
public:
|
|
enum class Color
|
|
{
|
|
Red = 0x01,
|
|
Green = 0x02,
|
|
Yellow = 0x03
|
|
};
|
|
private:
|
|
uint8_t RandomDisc();
|
|
public:
|
|
TrafficLightCommand();
|
|
public:
|
|
void UsingA();
|
|
void UsingB();
|
|
public:
|
|
byte* CMD_EnterIdentifyMode();
|
|
byte* CMD_CheckResult(Color color);
|
|
byte* CMD_CheckRandomResult();
|
|
public:
|
|
bool IsTrafficLightCommand(byte* cmd);
|
|
bool ModeChangeSuccess(byte* cmd);
|
|
};
|
|
|
|
#endif
|
|
|