Fast AnalogIn module which asks for a single non blocking reading and causes and interrupt when done.

Revision:
0:058d32b78e5d
Child:
1:2666729acca1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/NbAnalogIn.h	Mon Mar 27 11:35:25 2017 +0000
@@ -0,0 +1,29 @@
+#include "mbed.h"
+
+#ifndef NBANALOGIN_H
+#define NBANALOGIN_H
+
+/** Library for non blocking ADC operation
+  */
+  
+class NbAnalogIn{
+public:
+    /**
+    * Create a NbAnalogIn object, sets up ADC
+    */
+    NbAnalogIn();
+    
+    /**
+    * does a single blocking read and returns a 12 bit output
+    */
+    unsigned int read();
+    
+    /**
+    * sets the interrupt to fire when ADC is finished
+    */
+    void readNb();
+        
+private:
+    
+};
+#endif
\ No newline at end of file