AD5270 Hello world

Dependencies:   AD5270 mbed

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

Files at this revision

API Documentation at this revision

Comitter:
adisuciu
Date:
Wed May 04 08:33:48 2016 +0000
Parent:
0:01e942c09c17
Commit message:
Initial revision

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 01e942c09c17 -r 68f1c45d6017 main.cpp
--- a/main.cpp	Tue May 03 14:15:25 2016 +0000
+++ b/main.cpp	Wed May 04 08:33:48 2016 +0000
@@ -1,13 +1,16 @@
 #include "mbed.h"
 #include "AD5270.h"
 
+const float VAL = 10000; // 10000 ohms
+
 Serial pc(USBTX, USBRX); ///< Serial interface to the pc
 
 AD5270 ad5270(D6,20000); // set chipselect and ad5270 max resistance
 
 int main() {
-    
     pc.printf("Current value of the AD5270 is %f", ad5270.read_RDAC ());    
-    while(1); 
+    ad5270.write_RDAC(VAL);
+    pc.printf("Current value of the AD5270 is %f", ad5270.read_RDAC ());    
+    while(1);
     
 }
\ No newline at end of file