Skip to content
This repository has been archived by the owner on Oct 15, 2021. It is now read-only.

added possibility to control power adapters from type B #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions send.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "RCSwitch.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

int main(int argc, char *argv[]) {

Expand All @@ -26,9 +27,17 @@ int main(int argc, char *argv[]) {

switch(command) {
case 1:
if(strlen(systemCode)==1) {
mySwitch.switchOn(atoi(systemCode), unitCode);
break;
}
mySwitch.switchOn(systemCode, unitCode);
break;
case 0:
if(strlen(systemCode)==1) {
mySwitch.switchOff(atoi(systemCode), unitCode);
break;
}
mySwitch.switchOff(systemCode, unitCode);
break;
default:
Expand Down