AD7790 Hello world application

Dependencies:   AD7790 mbed

For additional information check out the mbed page of the Analog Devices wiki: https://wiki.analog.com/resources/tools-software/mbed-drivers-all

main.cpp

Committer:
adisuciu
Date:
2016-05-04
Revision:
0:7e16d7d35a02

File content as of revision 0:7e16d7d35a02:

#include "mbed.h"
#include "AD7790.h"
//------------------------------------
// Hyperterminal configuration
// 9600 bauds, 8-bit data, no parity
//------------------------------------

Serial pc(SERIAL_TX, SERIAL_RX);
AD7790 ad7790(1.2,D8); // reference voltage 1.2 V - only used in voltage computations

 
int main() {
  pc.printf("Hello AD7790 !\r\n");
  ad7790.reset();
  while(1) { 
      wait(1);
      pc.printf("Data register read from the ADC is %x \r\n", ad7790.read_u16());
  }
}