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.
Diff: main.cpp
- Revision:
- 2:af24b3afa99d
- Parent:
- 1:d7c55044d4b7
- Child:
- 3:5c45cb513aaf
diff -r d7c55044d4b7 -r af24b3afa99d main.cpp --- a/main.cpp Tue Mar 01 14:09:29 2016 +0000 +++ b/main.cpp Wed Mar 02 13:52:28 2016 +0000 @@ -1,23 +1,28 @@ #include "mbed.h" -#include "tsz124_class.h" +#include "x_nucleo_ika01a1_class.h" Serial pc(SERIAL_TX, SERIAL_RX); DigitalOut myled(LED1); int main() { - - DevI2C i2c(D14, D15); - TSZ124 opAmp(0, i2c); + 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; + unsigned int voltage = 100; pc.printf("\nhello world\n"); while(1) { pc.printf("\nwhile loop\n"); - pc.printf("\nopAmp measured voltage: %u \n", opAmp.GetVoltage()); - pc.printf("\nopAmp measured Current: %u \n", opAmp.GetCurrent()); - pc.printf("\nphotodiode sensor output voltage: %u \n", opAmp.GetPhotoSensorValue()); + 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()); myled = !myled; wait(1); }