From 178835c160940772341615dab7a239c45a875807 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 7 Aug 2018 17:31:59 +0200 Subject: Add AM2320 driver --- include/driver/am2320.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 include/driver/am2320.h (limited to 'include') diff --git a/include/driver/am2320.h b/include/driver/am2320.h new file mode 100644 index 0000000..39c5f7e --- /dev/null +++ b/include/driver/am2320.h @@ -0,0 +1,22 @@ +#ifndef AM2320_H +#define AM2320_H + +class AM2320 { + private: + AM2320(const AM2320 ©); + unsigned char const address; + unsigned char txbuf[3]; + unsigned char rxbuf[8]; + + public: + AM2320(unsigned char const addr) : address(addr) {} + + void read(); + unsigned char getStatus(); + float getTemp(); + float getHumidity(); +}; + +extern AM2320 am2320; + +#endif -- cgit v1.2.3