This commit is contained in:
2026-04-25 03:05:25 +02:00
parent 0daca6f46b
commit 09b1a6707a
4 changed files with 16 additions and 8 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
#include <hardware/pwm.h>
#include <pico/types.h>
#include <stdio.h>
#include "const.h"
#include "synth.h"
@@ -13,8 +14,8 @@ void pwm_isr(void) {
pwm_clear_irq(slice);
// TODO:
float sample = get_sample();
printf("sample: %f\n", sample);
uint16_t level = (uint16_t)((sample + 1.0f) * 0.5f * 3400.0f);
pwm_set_chan_level(slice, chan, level);