Compare commits
2 Commits
282462757f
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 6678db4565 | |||
| c646128e10 |
@ -10,6 +10,9 @@ I2S i2s(OUTPUT);
|
||||
#define BLOCKSIZE 64 // Heavy block size
|
||||
#define BUFFERSIZE (2 * BLOCKSIZE) // Stereo interleaved
|
||||
|
||||
bool state;
|
||||
int delta;
|
||||
|
||||
int16_t buffer[BUFFERSIZE];
|
||||
|
||||
inline int16_t float_to_i16(float x) {
|
||||
@ -70,9 +73,17 @@ void setup() {
|
||||
while (100);
|
||||
}
|
||||
|
||||
delay(100);
|
||||
delay(2000);
|
||||
hv->sendFloatToReceiver(hv_string_to_hash("osc_freq_input"), 880);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
||||
if (millis() - delta > 1000) {
|
||||
int freq;
|
||||
if (state) freq = 440;
|
||||
else freq = 880;
|
||||
hv->sendFloatToReceiver(hv_string_to_hash("osc_freq_input"), freq);
|
||||
state = !state;
|
||||
delta = millis();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user