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.
Dependencies: mbed
Command.h
- Committer:
- uswickra
- Date:
- 2014-08-31
- Revision:
- 0:ece62a42511f
- Child:
- 2:04d8e2ad8cff
File content as of revision 0:ece62a42511f:
extern Serial pc; extern DigitalOut led1; extern DigitalOut led2; extern DigitalOut led3; extern DigitalOut led4; class Cmd{ protected: char* cmd_name; public: virtual void execute(int arg_val){ pc.puts("ERR\n"); } char* get_name(){ return cmd_name; }; }; class Led_On_Cmd: public Cmd{ public: Led_On_Cmd(){ cmd_name = "LON"; } void execute(int arg_val){ pc.puts("LON SUCCESS \n"); if(arg_val == 1){ led1 = 1; }else if (arg_val == 2){ led2 = 1; }else if (arg_val == 3){ led3 = 1; } else if (arg_val == 4){ led4 = 1; } } }; class Led_Off_Cmd: public Cmd{ public: Led_Off_Cmd(){ cmd_name = "LOF"; } void execute(int arg_val){ pc.puts("LOF SUCCESS \n"); if(arg_val == 1){ led1 = 0; }else if (arg_val == 2){ led2 = 0; }else if (arg_val == 3){ led3 = 0; } else if (arg_val == 4){ led4 = 0; } } };