Cortex Challenge Team / Mbed 2 deprecated Nucleo_read_ios

Dependencies:   mbed

main.cpp

Committer:
dousape2
Date:
2015-03-21
Revision:
1:8fc51018d66d
Parent:
0:7b3cd0e11b6e
Child:
2:8af0223a6c51

File content as of revision 1:8fc51018d66d:

/**********************************************************************************
* @file    main.cpp
* @author  Name
* @version V0.1
* @date    09-March-2015
* @brief   Does something.
*          Even this! 
***********************************************************************************/

/* Includes ----------------------------------------------------------------------*/
#include "mbed.h"
 
//mbed - initialization of peripherals
PortIn myIOs(PortC, 0xE000); // PC_15 + PC_14 + PC_13
DigitalOut myled(LED1);
 
 /* Functions----------------------------------------------------------------------*/
 
 
/***********************************************************************************
* Function Name  : main.
* Description    : Main routine.
* Input          : None.
* Output         : None.
* Return         : None.
***********************************************************************************/
int main() {
  myIOs.mode(PullNone); // PullDown PullUp PullNone OpenDrain
  while(1) {
    if (myIOs.read() != 0xE000 && myIOs != 0xE000) { // Any of the 3 IOs is low, two posibility to read value
      myled = !myled; // Toggle LED state
      wait(0.2);
    }
  }
}