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.
38 lines
593 B
C
38 lines
593 B
C
![]()
2 years ago
|
// 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
|
||
|
};
|
||
|
public:
|
||
|
TrafficLightCommand();
|
||
|
public:
|
||
|
void UsingA();
|
||
|
void UsingB();
|
||
|
public:
|
||
|
byte* CMD_EnterIdentifyMode();
|
||
|
byte* CMD_CheckResult(Color color);
|
||
|
public:
|
||
|
bool IsTrafficLightCommand(byte* cmd);
|
||
|
bool ModeChangeSuccess(byte* cmd);
|
||
|
};
|
||
|
|
||
|
#endif
|
||
|
|