AD7790 Hello world application

Dependencies:   AD7790 mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "AD7790.h"
00003 //------------------------------------
00004 // Hyperterminal configuration
00005 // 9600 bauds, 8-bit data, no parity
00006 //------------------------------------
00007 
00008 Serial pc(SERIAL_TX, SERIAL_RX);
00009 AD7790 ad7790(1.2,D8); // reference voltage 1.2 V - only used in voltage computations
00010 
00011  
00012 int main() {
00013   pc.printf("Hello AD7790 !\r\n");
00014   ad7790.reset();
00015   while(1) { 
00016       wait(1);
00017       pc.printf("Data register read from the ADC is %x \r\n", ad7790.read_u16());
00018   }
00019 }
00020