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.
Command.h
- Committer:
- Xiaofei
- Date:
- 2015-11-28
- Revision:
- 4:3fbe2d75f7eb
- Parent:
- 3:97a5a3744481
- Child:
- 7:3dee2b884e1f
File content as of revision 4:3fbe2d75f7eb:
#pragma once
#include <cstdint>
class Command
{
public:
Command();
Command(const Command&);
virtual ~Command(){}
virtual void execute() = 0;
void setSpeed(const std::int8_t& sp=0.5, const std::int8_t& is_negative = 0);
protected:
float _SPEED;
bool _IS_NEGATIVE;
};
class LedCommand : public Command
{
public:
LedCommand(){}
virtual void execute();
};
class TurnLeftCommand : public Command
{
public:
TurnLeftCommand(){}
virtual void execute();
};
class TurnRightCommand : public Command
{
public:
TurnRightCommand(){}
virtual void execute();
};
class StopCommand : public Command
{
public:
StopCommand(){}
virtual void execute();
};