From 3bef2d097692a2e35185b26cf83408c104a494bf Mon Sep 17 00:00:00 2001 From: Trent Gill Date: Fri, 5 Jul 2024 20:53:37 -0700 Subject: [PATCH] add light indication of stepped modulator --- lib/stepped.c | 4 ++++ lib/stepped.h | 1 + main.c | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/stepped.c b/lib/stepped.c index 35c0ac2..f3b51f7 100644 --- a/lib/stepped.c +++ b/lib/stepped.c @@ -63,6 +63,10 @@ void stepped(float _steps, int _reset, int _twoup, int _down){ } } +int stepped_ix(void){ + return current_step; +} + int stepped_get(void){ // perform scaling return vsteps[current_step]; diff --git a/lib/stepped.h b/lib/stepped.h index 8e6988b..9196d8f 100644 --- a/lib/stepped.h +++ b/lib/stepped.h @@ -5,3 +5,4 @@ void stepped_init(void); void stepped(float _steps, int _reset, int _twoup, int _down); int stepped_get(void); +int stepped_ix(void); diff --git a/main.c b/main.c index 9b0e824..67336bc 100755 --- a/main.c +++ b/main.c @@ -99,7 +99,7 @@ int main(void){ int a = ADC_get(4); // raw 0~4095 value a *= 12; // scale up to 12*4096 a >>= 12; // divide by 4096 - lights_xset(a); + lights_xset(stepped_ix()); // Caw_printf("%i\n\r",a); } for(int i=0; i<6; i++){