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.

main.cpp

Committer:
hemddabral
Date:
2016-03-02
Revision:
2:af24b3afa99d
Parent:
1:d7c55044d4b7
Child:
3:5c45cb513aaf

File content as of revision 2:af24b3afa99d:

#include "mbed.h"
#include "x_nucleo_ika01a1_class.h"

Serial pc(SERIAL_TX, SERIAL_RX);

DigitalOut myled(LED1);

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;
    
    unsigned int voltage = 100;

    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());                                    
        myled = !myled;
        wait(1);
    }
}