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 3:5c45cb513aaf, committed 2016-03-16
- Comitter:
- hemddabral
- Date:
- Wed Mar 16 09:21:47 2016 +0000
- Parent:
- 2:af24b3afa99d
- Child:
- 4:6ed99ea3bf33
- Commit message:
- updated main programm;
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 Wed Mar 02 13:52:28 2016 +0000 +++ b/X_NUCLEO_IKA01A1.lib Wed Mar 16 09:21:47 2016 +0000 @@ -1,1 +1,1 @@ -https://developer.mbed.org/users/hemddabral/code/X_NUCLEO_IKA01A1/#19d1dcef0c0e +https://developer.mbed.org/users/hemddabral/code/X_NUCLEO_IKA01A1/#997327f69b10
--- a/main.cpp Wed Mar 02 13:52:28 2016 +0000
+++ b/main.cpp Wed Mar 16 09:21:47 2016 +0000
@@ -1,7 +1,7 @@
#include "mbed.h"
#include "x_nucleo_ika01a1_class.h"
-Serial pc(SERIAL_TX, SERIAL_RX);
+Serial pc(USBTX, USBRX);
DigitalOut myled(LED1);
@@ -11,19 +11,35 @@
TSZ124 *instrAmp = analog_expansion_board->tsz124;
TSU104 *photoSensor_windComp = analog_expansion_board->tsu104;
-
- unsigned int voltage = 100;
+ TSV734 *led_Driver = analog_expansion_board->tsv734;
+ led_Driver->Configure(1000);
+ float dutyCycle_us = 0;
pc.printf("\nhello world\n");
while(1) {
- pc.printf("\nwhile loop\n");
- pc.printf("\nopAmp measured voltage: %u \n", instrAmp->GetVoltage());
- pc.printf("\nopAmp measured Current: %u \n", instrAmp->GetCurrent());
- pc.printf("\nphotodiode sensor output voltage: %u \n", photoSensor_windComp->TSU104_PhotoSensor_GetVoltage());
- pc.printf("\nWindows comparator: state of pin D2: %u \n", photoSensor_windComp->TSU104_WindComp_Get_D2());
- pc.printf("\nWindows comparator: state of pin D4: %u \n", photoSensor_windComp->TSU104_WindComp_Get_D4());
+ pc.printf("\nwhile loop\n");
+
+ unsigned int opAmpVoltage = instrAmp->GetVoltage();
+ unsigned int opAmpCurrent = instrAmp->GetCurrent();
+ unsigned int photoSensorVoltage = photoSensor_windComp->TSU104_PhotoSensor_GetVoltage();
+ unsigned int windComPinD2 = photoSensor_windComp->TSU104_WindComp_Get_D2();
+ unsigned int windComPinD4 = photoSensor_windComp->TSU104_WindComp_Get_D4();
+
+ pc.printf("\nopAmp measured voltage(mV): %u \n", opAmpVoltage);
+ pc.printf("\nopAmp measured Current(mA): %u \n", opAmpCurrent);
+ pc.printf("\nphotodiode sensor output voltage(mV): %u \n", photoSensorVoltage);
+ pc.printf("\nWindows comparator: state of pin D2: %u \n", windComPinD2);
+ pc.printf("\nWindows comparator: state of pin D4: %u \n", windComPinD4);
+
+ dutyCycle_us += 10;
+ pc.printf("\nLED Driver: duty cycle: %u percent \n", led_Driver->SetDutyCycle(dutyCycle_us));
+
+ if(dutyCycle_us>=100)
+ dutyCycle_us -= 100;
+
myled = !myled;
wait(1);
}
+
}

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