Used as part of the OU_Davis_Old_Robot library
MCP3008.h
- Committer:
- DrewSchaef
- Date:
- 2017-11-01
- Revision:
- 0:2cb766caa4c7
File content as of revision 0:2cb766caa4c7:
// // // #ifndef _MCP3008_H #define _MCP3008_H #include <mbed.h> class MCP3008 { protected: SPI _spi; DigitalOut _cs; float _vref; int _data1; int _data2; public: MCP3008(PinName mosi=p11, PinName miso=p12, PinName clk=p13, PinName cs=p14); int read(int ch); float vref(float v){return _vref=v;} }; #endif //_MCP3008_H