You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
389 B

2 years ago
  1. #include"led.h"
  2. #include<string>
  3. using namespace std;
  4. int main(int argc, char* argv[]){
  5. CLED led1 = CLED(3);
  6. string cmd(argv[1]);
  7. if(argc!=2)
  8. std::cout << "Incorrect number of arguments" << std::endl;
  9. if(cmd=="on")
  10. led1.TurnOn();
  11. else if(cmd=="off")
  12. led1.TurnOff();
  13. else if(cmd=="blink")
  14. led1.BlinkLED();
  15. else
  16. cout << "Invalid command" << endl;
  17. return 0;
  18. }