forked from circuitar/Dimmer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Maximize switching rate in count mode, reduce ISR processing time, ad…
…d Fade example with 10 lamps.
- Loading branch information
Showing
3 changed files
with
82 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* Dim many lamps simultaneously. | ||
* | ||
* Copyright (c) 2016 Circuitar | ||
* This software is released under the MIT license. See the attached LICENSE file for details. | ||
*/ | ||
|
||
#include "Dimmer.h" | ||
|
||
Dimmer dimmers[] = { | ||
Dimmer(3, DIMMER_RAMP), | ||
Dimmer(5, DIMMER_RAMP), | ||
Dimmer(6, DIMMER_RAMP), | ||
Dimmer(9, DIMMER_RAMP), | ||
Dimmer(4, DIMMER_RAMP), | ||
Dimmer(7, DIMMER_RAMP), | ||
Dimmer(A2, DIMMER_RAMP), | ||
Dimmer(A3, DIMMER_RAMP), | ||
Dimmer(A4, DIMMER_RAMP), | ||
Dimmer(A5, DIMMER_RAMP) | ||
}; | ||
|
||
void setup() { | ||
for(int i = 0; i < sizeof(dimmers) / sizeof(Dimmer); i++) { | ||
dimmers[i].begin(); | ||
} | ||
} | ||
|
||
void loop() { | ||
for(int i = 0; i < sizeof(dimmers) / sizeof(Dimmer); i++) { | ||
dimmers[i].set(100); | ||
} | ||
delay(1500); | ||
|
||
for(int i = 0; i < sizeof(dimmers) / sizeof(Dimmer); i++) { | ||
dimmers[i].set(0); | ||
} | ||
delay(1500); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters