FastLED 3.9.15
Loading...
Searching...
No Matches

◆ DbgDoSimulatedKeyboardPress()

void DbgDoSimulatedKeyboardPress ( )

Definition at line 139 of file LuminescentGrand.ino.

139 {
140#ifdef DEBUG_FORCED_KEYBOARD
141 static uint32_t start_time = 0;
142 static bool toggle = 0;
143
144 const uint32_t time_on = 25;
145 const uint32_t time_off = 500;
146
147 // Just force it on whenever this function is called.
148 is_debugging = true;
149
150 uint32_t now = fl::millis();
151 uint32_t delta_time = now - start_time;
152
153
154 uint32_t threshold_time = toggle ? time_off : time_on;
155 if (delta_time < threshold_time) {
156 return;
157 }
158
159 int random_key = random(0, 88);
160
161 start_time = now;
162 if (toggle) {
163 HandleNoteOn(0, random_key, 64);
164 } else {
165 HandleNoteOff(0, random_key, 82);
166 }
167 toggle = !toggle;
168#endif
169}
bool toggle
Definition Blur.ino:12
void HandleNoteOff(byte channel, byte midi_note, byte velocity)
void HandleNoteOn(byte channel, byte midi_note, byte velocity)
bool is_debugging
Definition dprint.cpp:5
fl::u32 uint32_t
Definition s16x16x4.h:219
fl::u32 millis()
Universal millisecond timer - returns milliseconds since system startup.

References HandleNoteOff(), HandleNoteOn(), is_debugging, fl::millis(), and toggle.

Referenced by loop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: