Analog Devices
/
ad7790-helloworld
AD7790 Hello world application
Embed:
(wiki syntax)
Show/hide line numbers
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
Generated on Wed Jul 13 2022 14:22:28 by 1.7.2