this simple program is an example to let u know how the ADC can be enabled in w7500

Dependencies:   mbed

Revision:
1:6b3079b2bfcc
Parent:
0:60d6189b9b0d
--- a/main.cpp	Wed Dec 23 10:27:26 2015 +0000
+++ b/main.cpp	Tue May 24 09:46:00 2016 +0000
@@ -1,22 +1,34 @@
 #include "mbed.h"
 AnalogIn Current(A0);
-int meas;
+PwmOut led(D9);
+int meas,i,max,a[10];
+float curren=0;
+int wattage;
+void led_toggle(int chan, uint32_t value)
+{
+    led = !led;
+}
 
 
 int main()
 {
-     printf("\n GSAS Micro Systems \r\n");
-     
-     wait(0.1f);
- 
-    while(1) {
-        meas = Current.read_u16();
-        
-            printf("value = %d\r\n",meas);
-            wait(0.1f);
-            }
-            
-  
-        }
-        
-    
\ No newline at end of file
+    printf("\n GSAS Micro Systems \r\n");
+    
+    wait(0.1f);
+    while(1){
+    meas = Current.read_u16();
+    printf("value = %d\r\n", meas);
+    curren = (meas - 2595) / 185;
+    printf("curren = %.2f\r\n", curren);
+    wattage = curren * 230;
+    printf("wattage = %d\r\n", wattage);
+   wait(0.5f) ;
+    }
+    
+
+    }
+    
+
+
+
+