Used as part of the OU_Davis_Old_Robot library
Embed:
(wiki syntax)
Show/hide line numbers
MCP3008.h
00001 // 00002 // 00003 // 00004 #ifndef _MCP3008_H 00005 #define _MCP3008_H 00006 00007 #include <mbed.h> 00008 00009 class MCP3008 { 00010 protected: 00011 SPI _spi; 00012 DigitalOut _cs; 00013 float _vref; 00014 int _data1; 00015 int _data2; 00016 00017 public: 00018 MCP3008(PinName mosi=p11, PinName miso=p12, PinName clk=p13, PinName cs=p14); 00019 int read(int ch); 00020 float vref(float v){return _vref=v;} 00021 }; 00022 00023 #endif //_MCP3008_H
Generated on Sun Jul 17 2022 02:13:36 by
1.7.2