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-22
- Revision:
- 1:13c4bf8989d5
- Parent:
- 0:4bc34a5fcc29
- Child:
- 3:97a5a3744481
File content as of revision 1:13c4bf8989d5:
#pragma once
#include <cstdint>
class Command
{
public:
Command();
Command(const Command&);
virtual ~Command(){}
virtual void execute() = 0;
void setSpeed(const std::int8_t& l_sp=0.5,const std::int8_t& r_sp=0.5);
protected:
float _LEFT_SPEED;
float _RIGHT_SPEED;
};
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 MoveForwardCommand : public Command
{
public:
MoveForwardCommand(){}
virtual void execute();
};
class MoveBackwardCommand : public Command
{
public:
MoveBackwardCommand(){}
virtual void execute();
};
class StopCommand : public Command
{
public:
StopCommand(){}
virtual void execute();
};