Skip to content

Commit

Permalink
made LED class roller resetable
Browse files Browse the repository at this point in the history
  • Loading branch information
MaEtUgR committed Dec 13, 2015
1 parent bca89b9 commit 681485c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion LED/LED.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ void LED::rollnext() {
tilt(roller);
}

void LED::rollreset() {
shownumber(0);
roller = 0;
}

void LED::tilt(int index) {
Led = Led ^ (1 << (index-1)); //XOR
}
Expand All @@ -57,4 +62,4 @@ int LED::check(int index) {

void LED::operator=(int value) {
Led = value;
}
}
3 changes: 2 additions & 1 deletion LED/LED.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class LED {
void ride(int times);
void roll(int times);
void rollnext();
void rollreset();
void tilt(int index);
void set(int index);
void reset(int index);
Expand All @@ -24,4 +25,4 @@ class LED {
int roller;
};

#endif
#endif

0 comments on commit 681485c

Please sign in to comment.