Analog Devices / Mbed 2 deprecated ad5270-helloworld

Dependencies:   AD5270 mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "AD5270.h"
00003 
00004 const float VAL = 10000; // 10000 ohms
00005 
00006 Serial pc(USBTX, USBRX); ///< Serial interface to the pc
00007 
00008 AD5270 ad5270(D6,20000); // set chipselect and ad5270 max resistance
00009 
00010 int main() {
00011     pc.printf("Current value of the AD5270 is %f", ad5270.read_RDAC ());    
00012     ad5270.write_RDAC(VAL);
00013     pc.printf("Current value of the AD5270 is %f", ad5270.read_RDAC ());    
00014     while(1);
00015     
00016 }