Simple test application for X-NUCLEO-IKA01A1 expansion board.

Dependencies:   X_NUCLEO_IKA01A1 mbed

Fork of HelloWorld_IKA01A1 by ST Expansion SW Team

Simple test application for X-NUCLEO-IKA01A1 expansion board.

Platform compatibility issues

  • NUCLEO-F302R8: use pin D5 for LED Driver configuration
  • LPCXpresso11U68: use pin D3 as PWM for LED Driver configuration. Use a free Dx pin as Signal2 for Windows Comparator configuration.
Revision:
13:179d5044bbc1
Parent:
11:71be8ec1ce5c
Child:
14:182526e41810
--- a/main.cpp	Fri Apr 08 09:23:31 2016 +0000
+++ b/main.cpp	Mon Apr 11 05:51:59 2016 +0000
@@ -10,13 +10,13 @@
                                                                           X_NUCLEO_IKA01A1_PIN_WINDOWS_COMP_SIGNAL_1,
                                                                           X_NUCLEO_IKA01A1_PIN_WINDOWS_COMP_SIGNAL_2,
                                                                           X_NUCLEO_IKA01A1_PIN_PWM_LED_DRIVER_OUTPUT,
-                                                                          50);
+                                                                          5000);
     analog_expansion_board->Init();
     TSZ124 *instrAmp = analog_expansion_board->tsz124;
     TSU104 *photoSensor_windComp = analog_expansion_board->tsu104;
     
     TSV734 *led_Driver = analog_expansion_board->tsv734;  
-    double dutyCycle_us = 0;    
+    double dutyCycle = 0;    
     
     while(1) {            
         pc.printf("\nwhile loop\n");       
@@ -34,16 +34,13 @@
         pc.printf("\nWindows comparator: signal 1 value(pin D2): %u \n", windComPin1);         
         pc.printf("\nWindows comparator: signal 1 value(pin D4): %u \n", windComPin2);   
         
-        dutyCycle_us += 0.1;  
-        pc.printf("\nLED Driver: duty cycle: %u percent \n", led_Driver->SetDutyCycle(dutyCycle_us));              
-        
-        if(dutyCycle_us>=1) 
-            dutyCycle_us -= 1;
-                                  
+        dutyCycle += 0.1; 
+        if(dutyCycle>=1) 
+            dutyCycle -= 1;
+                     
+        pc.printf("\nLED Driver: duty cycle: %.2lf percent \n", led_Driver->SetDutyCycle(dutyCycle));              
+                                          
         myled = !myled;
         wait(1);      
-                                  
-        myled = !myled;
-        wait(1);
     }    
 }