A library to interface to the MCP3208 SPI-based ADC from Microchip. This chip provides eight analogue inputs, providing converted 12-bit values via SPI.

Dependents:   Nucleo_MCP3208_Test Nucleo_MCP3208_Ticker_Test BBMv2_eps ref_BBMv2_eps ... more

Revision:
0:d37e8cb188c1
Child:
1:316f86115221
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mcp3208.h	Mon May 23 22:58:59 2011 +0000
@@ -0,0 +1,25 @@
+#include "mbed.h"
+
+
+#ifndef MCP3208_H
+#define MCP3208_H
+
+
+class MCP3208
+{
+public:
+    MCP3208(SPI bus, PinName cs);
+    ~MCP3208();
+    
+    int read_input(int channel);
+  
+private:
+    DigitalOut m_cs;
+    SPI m_bus;
+    
+    void select();
+    void deselect();
+};
+
+
+#endif