Nucleo_ADC

Dependencies:   mbed

main.cpp

Committer:
anoney180133
Date:
2015-12-11
Revision:
0:b3f45f22272f

File content as of revision 0:b3f45f22272f:

#include "mbed.h"

//------------------------------------
// Hyperterminal configuration
// 115200 bauds(Default 9600), 8-bit data, no parity
//------------------------------------
/* No need Serial to UART just usb debugger. */

Serial UART(SERIAL_TX, SERIAL_RX); // TX PA_2 , RX PA_3

AnalogIn ADC_Channel0(PA_0);
AnalogIn ADC_Channel1(PA_1);


void UARTIrq();

 
int main() 
{
  UART.baud(115200); // Set BuadRate
  printf("Read ADC Testing.\r\n");
  while(1) 
  { 
      wait_ms(250);
      printf("ADC1_IN0(A0) = %d , ADC1_IN1(A1) = %d \r\n", ADC_Channel0.read_u16(),ADC_Channel1.read_u16());
  }
}