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.cpp@0:4bc34a5fcc29, 2015-11-21 (annotated)
- Committer:
- Xiaofei
- Date:
- Sat Nov 21 17:17:41 2015 +0000
- Revision:
- 0:4bc34a5fcc29
- Child:
- 1:13c4bf8989d5
ghghg
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Xiaofei | 0:4bc34a5fcc29 | 1 | #pragma once |
| Xiaofei | 0:4bc34a5fcc29 | 2 | #include "Command.h" |
| Xiaofei | 0:4bc34a5fcc29 | 3 | #include "mbed.h" |
| Xiaofei | 0:4bc34a5fcc29 | 4 | |
| Xiaofei | 0:4bc34a5fcc29 | 5 | static DigitalOut led1(LED1); |
| Xiaofei | 0:4bc34a5fcc29 | 6 | |
| Xiaofei | 0:4bc34a5fcc29 | 7 | |
| Xiaofei | 0:4bc34a5fcc29 | 8 | void LedCommand :: execute() |
| Xiaofei | 0:4bc34a5fcc29 | 9 | { |
| Xiaofei | 0:4bc34a5fcc29 | 10 | led1 = !led1; |
| Xiaofei | 0:4bc34a5fcc29 | 11 | } |
| Xiaofei | 0:4bc34a5fcc29 | 12 | |
| Xiaofei | 0:4bc34a5fcc29 | 13 | void TurnLeftCommand :: execute() |
| Xiaofei | 0:4bc34a5fcc29 | 14 | { |
| Xiaofei | 0:4bc34a5fcc29 | 15 | } |
| Xiaofei | 0:4bc34a5fcc29 | 16 | |
| Xiaofei | 0:4bc34a5fcc29 | 17 | void TurnRightCommand :: execute() |
| Xiaofei | 0:4bc34a5fcc29 | 18 | { |
| Xiaofei | 0:4bc34a5fcc29 | 19 | } |
| Xiaofei | 0:4bc34a5fcc29 | 20 | |
| Xiaofei | 0:4bc34a5fcc29 | 21 | void MoveForwardCommand :: execute() |
| Xiaofei | 0:4bc34a5fcc29 | 22 | { |
| Xiaofei | 0:4bc34a5fcc29 | 23 | } |
| Xiaofei | 0:4bc34a5fcc29 | 24 | |
| Xiaofei | 0:4bc34a5fcc29 | 25 | void MoveBackwardCommand :: execute() |
| Xiaofei | 0:4bc34a5fcc29 | 26 | { |
| Xiaofei | 0:4bc34a5fcc29 | 27 | } |
| Xiaofei | 0:4bc34a5fcc29 | 28 | |
| Xiaofei | 0:4bc34a5fcc29 | 29 | void StopCommand :: execute() |
| Xiaofei | 0:4bc34a5fcc29 | 30 | { |
| Xiaofei | 0:4bc34a5fcc29 | 31 | } |
| Xiaofei | 0:4bc34a5fcc29 | 32 |