Librería para leer temperatura haciendo comunicación SPI con el integrado MAX6675
Diff: max6675.h
- Revision:
- 0:33fb492d139e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/max6675.h Mon Jun 08 23:18:38 2020 +0000 @@ -0,0 +1,26 @@ +#ifndef MAX6675_h +#define MAX6675_h + +#include "mbed.h" + +class max6675 +{ + SPI& spi; + DigitalOut ss; + public: + + max6675(SPI& _spi, PinName _ss); + + void select(); + void deselect(); + float read_temp(); + + private: + PinName _CS_pin; + PinName _SO_pin; + PinName _SCK_pin; + int _units; + float _error; +}; + +#endif \ No newline at end of file