dependent repository for sendFootSensorsPackets (The UDP packet repos)
Dependents: sendFootSensorsPacketsFinalUDP
mcp3208.h@0:e44491917262, 2016-07-01 (annotated)
- Committer:
- mmellor
- Date:
- Fri Jul 01 18:53:27 2016 +0000
- Revision:
- 0:e44491917262
UDP Packet Sender (UDP packets constructed on the mbed side)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mmellor | 0:e44491917262 | 1 | // |
mmellor | 0:e44491917262 | 2 | // |
mmellor | 0:e44491917262 | 3 | // |
mmellor | 0:e44491917262 | 4 | #ifndef _MCP3208_H |
mmellor | 0:e44491917262 | 5 | #define _MCP3208_H |
mmellor | 0:e44491917262 | 6 | |
mmellor | 0:e44491917262 | 7 | #include <mbed.h> |
mmellor | 0:e44491917262 | 8 | |
mmellor | 0:e44491917262 | 9 | class MCP3208 { |
mmellor | 0:e44491917262 | 10 | protected: |
mmellor | 0:e44491917262 | 11 | SPI _spi; |
mmellor | 0:e44491917262 | 12 | DigitalOut _cs; |
mmellor | 0:e44491917262 | 13 | float _vref; |
mmellor | 0:e44491917262 | 14 | |
mmellor | 0:e44491917262 | 15 | public: |
mmellor | 0:e44491917262 | 16 | MCP3208(PinName mosi=p11, PinName miso=p12, PinName clk=p13, PinName cs=p14); |
mmellor | 0:e44491917262 | 17 | int binary(int ch); |
mmellor | 0:e44491917262 | 18 | float volt(int ch); |
mmellor | 0:e44491917262 | 19 | float vref(float v){return _vref=v;} |
mmellor | 0:e44491917262 | 20 | }; |
mmellor | 0:e44491917262 | 21 | |
mmellor | 0:e44491917262 | 22 | #endif //_MCP3208_H |