@@ -98,16 +98,16 @@ void toggle();
98
98
// set ON / OFF permanently
99
99
void permanent (bool enable);
100
100
101
- // blink infinitely. Speed is fast by default.
102
- void blink(SpeedSetting speed = SPEED_FAST );
101
+ // blink infinitely
102
+ void blink();
103
103
104
104
// blink ` num ` times, then long pause
105
105
// repeats, if ` repeat ` is set, OFF otherwise.
106
- void pattern(int num, bool repeat = true, SpeedSetting speed = SPEED_FAST );
106
+ void pattern(int num, bool repeat = true);
107
107
108
108
// blink ` num1 ` times, short pause, blink ` num2 ` times, long pause
109
109
// repeats, if ` repeat ` is set, OFF otherwise.
110
- void pattern(int num1, int num2, bool repeat = true, SpeedSetting speed = SPEED_FAST );
110
+ void pattern(int num1, int num2, bool repeat = true);
111
111
112
112
// turn ON for the given duration in ms. Continues in the previous mode afterwards.
113
113
void flash(uint16_t duration_ms);
@@ -117,15 +117,19 @@ void pause(uint16_t duration_ms);
117
117
118
118
// setup the timing parameters
119
119
void setSpeed(SpeedSetting setting);
120
+
120
121
// Available by default: SPEED_RAPID, SPEED_FAST, SPEED_SLOW
122
+ myLed.setSpeed(SPEED_RAPID);
123
+ myLed.setSpeed(SPEED_FAST);
124
+ myLed.setSpeed(SPEED_SLOW);
121
125
122
- // Or use your own settings. SpeedSetting is a struct:
126
+ // .. or use your own settings. SpeedSetting is a struct:
123
127
typedef struct
124
128
{
125
- uint16_t on_ms;
126
- uint16_t off_ms;
127
- uint16_t pause_ms;
128
- uint16_t ending_ms;
129
+ uint16_t on_ms; // ON time in milliseconds
130
+ uint16_t off_ms; // OFF time in milliseconds
131
+ uint16_t pause_ms; // pause between ` num1 ` and ` num2 ` in pattern()
132
+ uint16_t ending_ms; // ending after a full pattern
129
133
} SpeedSetting;
130
134
131
135
// ... alternatively you can setup the speed settings directly
@@ -135,7 +139,8 @@ void setSpeed(
135
139
uint16_t pause_ms,
136
140
uint16_t ending_ms);
137
141
138
- // ... or by providing a single value, the other values are inferred from that
142
+ // ... or by providing a single value, the other values are inferred from that by
143
+ // some internal factors
139
144
void setSpeed(uint16_t on_ms);
140
145
141
146
// Hint: You can also modify the values directly - even on the fly - e.g.:
0 commit comments