Simple test application for X-NUCLEO-IKA01A1 expansion board.
Dependencies: X_NUCLEO_IKA01A1 mbed
Fork of HelloWorld_IKA01A1 by
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, committed 2016-04-11
- Comitter:
- hemddabral
- Date:
- Mon Apr 11 05:51:59 2016 +0000
- Parent:
- 12:149b7c28bd1f
- Child:
- 14:182526e41810
- Commit message:
- updated LED driver implementation and API
Changed in this revision
| X_NUCLEO_IKA01A1.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/X_NUCLEO_IKA01A1.lib Fri Apr 08 09:23:31 2016 +0000 +++ b/X_NUCLEO_IKA01A1.lib Mon Apr 11 05:51:59 2016 +0000 @@ -1,1 +1,1 @@ -https://developer.mbed.org/users/hemddabral/code/X_NUCLEO_IKA01A1/#25dbc718084c +https://developer.mbed.org/users/hemddabral/code/X_NUCLEO_IKA01A1/#af35fc938d88
--- 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);
}
}

X-NUCLEO-IKA01A1 Multifunctional board based on operational amplifiers.