Experimental implementation of the adaptive filter of "Interface" magazine in 2016-2017

Dependencies:   amakusa mbed-dsp mbed shimabara ukifune unzen_nucleo_f746

Fork of skeleton_unzen_nucleo_f746 by seiichi horie

ハードウェアおよびソフトウェアはskelton_unzen_nucleo_f746を基本にしています。

Revision:
20:699e209fd19a
Parent:
18:b9b1116f8768
--- a/main.cpp	Fri Feb 03 14:35:46 2017 +0000
+++ b/main.cpp	Fri Feb 03 14:41:40 2017 +0000
@@ -42,47 +42,33 @@
 int main() 
 {    
     uint32_t pushing, releasing, holding;
-    
-        // VFO form
-    wave_form form = triangle;
 
         // start audio. Do not touch
     initialize_system();
-    
-    process->set_vfo_frequency( 440 );
-    process->set_vfo_wave_form( form );
-    ukifune::turn_led_off( ukifune::led1_1 );
-    ukifune::turn_led_on( ukifune::led1_2 );
  
        // main loop. Signal processing is done in background.
     while(1)     
     {       // place your foreground program here.
 
             // get volume from UI panel, then apply it to signal processing.
-        process->set_volume( ukifune::get_volume(0) );  
-        process->set_vfo_duty_cycle( ukifune::get_volume(1) ); 
+        process->set_volume( ukifune::get_volume(0) );   
        
             // sample usage of button switch detection
         ukifune::get_button_state( pushing, releasing, holding);
 
             // pushing detection demo
         if ( pushing & (1 << ukifune::swm1 ) )      // is SWM1 switch pusshing down?
-            if  ( form == triangle )
-            {
-                form = square;
-                process->set_vfo_wave_form( form );
-                ukifune::turn_led_on( ukifune::led1_1 );
-                ukifune::turn_led_off( ukifune::led1_2 );
-            }
-            else
-            {
-                form = triangle;
-                process->set_vfo_wave_form( form );
-                ukifune::turn_led_off( ukifune::led1_1 );
-                ukifune::turn_led_on( ukifune::led1_2 );
-            }
-            
+            ukifune::toggle_led( ukifune::led1_1 ); // then, toggle LED1_1 
 
+            // releasing detection demo     
+        if ( releasing & (1 << ukifune::swm2 ) )    // is SWM2 switch releasing? 
+            ukifune::toggle_led( ukifune::led2_1 ); // then toggle LED2_1
+       
+            // holding detection demo     
+        if ( holding & (1 << ukifune::swm3 ) )    // is SWM3 switch holding? 
+            ukifune::turn_led_on( ukifune::led3_1 );    // then turn LED3_1 on
+        else
+            ukifune::turn_led_off( ukifune::led3_1 );   // else off
 
        
             // you have to call tick() every 20mS-50mS if you need get_volume()