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-21
- Revision:
- 0:4bc34a5fcc29
- Child:
- 1:13c4bf8989d5
File content as of revision 0:4bc34a5fcc29:
#pragma once
#include <cstdint>
class Command
{
public:
Command():_speed(0){}
Command(const Command&);
virtual ~Command(){}
virtual void execute() = 0;
void setSpeed(const std::int8_t& sp){_speed = sp;}
protected:
float _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();
};