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 4:6ed99ea3bf33, committed 2016-03-17
- Comitter:
- hemddabral
- Date:
- Thu Mar 17 10:35:39 2016 +0000
- Parent:
- 3:5c45cb513aaf
- Child:
- 5:72d4e1821966
- Commit message:
- updated test program
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 16 09:21:47 2016 +0000 +++ b/X_NUCLEO_IKA01A1.lib Thu Mar 17 10:35:39 2016 +0000 @@ -1,1 +1,1 @@ -https://developer.mbed.org/users/hemddabral/code/X_NUCLEO_IKA01A1/#997327f69b10 +https://developer.mbed.org/users/hemddabral/code/X_NUCLEO_IKA01A1/#5dd31859cea3
--- a/main.cpp Wed Mar 16 09:21:47 2016 +0000
+++ b/main.cpp Thu Mar 17 10:35:39 2016 +0000
@@ -5,41 +5,29 @@
DigitalOut myled(LED1);
-int main() {
+int main() {
X_NUCLEO_IKA01A1 *analog_expansion_board = X_NUCLEO_IKA01A1::Instance();
analog_expansion_board->Init();
TSZ124 *instrAmp = analog_expansion_board->tsz124;
+ TSU104 *photoSensor_windComp = analog_expansion_board->tsu104;
- TSU104 *photoSensor_windComp = analog_expansion_board->tsu104;
- TSV734 *led_Driver = analog_expansion_board->tsv734;
- led_Driver->Configure(1000);
- float dutyCycle_us = 0;
-
- pc.printf("\nhello world\n");
-
- while(1) {
+ while(1) {
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();
-
+ unsigned int opAmpVoltage = instrAmp->GetVoltage();
+ unsigned int opAmpCurrent = instrAmp->GetCurrent();
+ // pass A3 on LPCxpresso lpc11u68
+ unsigned int photoSensorVoltage = photoSensor_windComp->TSU104_PhotoSensor_GetVoltage(A3);
+ 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;
+ pc.printf("\nWindows comparator: state of pin D4: %u \n", windComPinD4);
myled = !myled;
wait(1);
- }
-
+ }
}

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