From 6678db45653e1d96cc48c3d7097d5730a3076f65 Mon Sep 17 00:00:00 2001 From: sallar Date: Tue, 2 Dec 2025 19:54:00 +0100 Subject: [PATCH] switching the frequency between 440 and 880 every second --- test-pico-io/src/main.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test-pico-io/src/main.cpp b/test-pico-io/src/main.cpp index 49aa2c1..b089e3c 100644 --- a/test-pico-io/src/main.cpp +++ b/test-pico-io/src/main.cpp @@ -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) { @@ -75,5 +78,12 @@ void setup() { } 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(); + } }