Rock Monitoring  V 1.0
PCT2075.h
Go to the documentation of this file.
1 #ifndef PCT2075_H
2 #define PCT2075_H
3 
4 //#include "WaspClasses.h"
5 
6 // PCT2075 internal register addresses
7 #define PCT2075_CONF 0x01
8 #define PCT2075_TEMP 0x00
9 #define PCT2075_TOS 0x03
10 #define PCT2075_THYST 0x02
11 #define PCT2075_TIDLE 0x04
12 
13 // number of bytes to be read from PCT2075
14 #define PCT2075_READ_LEN 1
15 
16 #include "WaspUSB.h"
17 #include <util/twi.h>
18 #include <stdlib.h>
19 #include <string.h>
20 #include <inttypes.h>
21 #include "Wire.h"
22 #include "printable.h"
23 #include "Waspmote.h"
24 #include "../Constants/Constants.h"
25 
26 #define RETURN_ERROR 1
27 #define RETURN_OK 0
28 
29 class PCT2075
30 {
31 public:
32 //methods
33  PCT2075(); //Constructor
34  void init(uint8_t slaveAddr); //configures PCT2075 temperature sensor
35  uint8_t getTemp(int8_t & Temp); //gets the temperatur value of the temperature sensor PCT2075
36  void goToSleep(); //sets the temperature Sensor in shutdown mode
37 
38 private:
39 //attributes
40  uint8_t i2cSlaveAddr;
41 };
42 
43 #endif /* PCT2075_H */
uint8_t i2cSlaveAddr
Definition: PCT2075.h:40
Class that handles the communication to the temperature sensor PCT2075.
Definition: PCT2075.h:29
PCT2075()
Definition: PCT2075.cpp:5
void goToSleep()
This method sets the Temperature Sensor in shutdown mode.
Definition: PCT2075.cpp:76
void init(uint8_t slaveAddr)
This method initializes the temperature sensor PCT2075.
Definition: PCT2075.cpp:12
uint8_t getTemp(int8_t &Temp)
This method gets the temperatur value of the temperature sensor PCT2075.
Definition: PCT2075.cpp:55