Demo code for AD5206 digital potentiometer

Dependencies:   AD5206 mbed

Files at this revision

API Documentation at this revision

Comitter:
taoqiuyang
Date:
Sat Oct 17 20:03:57 2015 +0000
Commit message:
AD5206 Demo Code

Changed in this revision

AD5206.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r c32f1c93007d AD5206.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/AD5206.lib	Sat Oct 17 20:03:57 2015 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/taoqiuyang/code/AD5206/#d2adf1f7e548
diff -r 000000000000 -r c32f1c93007d main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Oct 17 20:03:57 2015 +0000
@@ -0,0 +1,29 @@
+/*
+AD5206 Test code
+
+Connection:
+|  mbed  |  AD5206 |
+|  VIN   |  VDD    |
+|  GND   |  VSS    | 
+|  GND   |  GND    |
+|  p5    |  SDI    |
+|  p7    |  CLK    |
+|  p8    |  CS'    |
+
+*/
+
+#include "mbed.h"
+#include <AD5206.h>
+
+AD5206 digipot(p5, p6, p7,p8);
+
+int val;
+int main() {
+    while(1) {
+        digipot.write_AD5206(0,val);
+        
+        val=val+1;
+        if (val==255){val=0;}
+        wait(0.1);
+    }
+}
diff -r 000000000000 -r c32f1c93007d mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Oct 17 20:03:57 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/34e6b704fe68
\ No newline at end of file