|
2 | 2 |
|
3 | 3 | This is a basic documentation about the library for the *SensorKit* .
|
4 | 4 |
|
5 |
| -The library can be downloaded from the Arduino IDE’s library manager or by going to the [github repository](https://github.com/arduino-libraries/Arduino_SensorKit) |
| 5 | +The library it's a wrapper of some libraries to use with the ![Arduino Sensor Kit](), it can be downloaded from the Arduino IDE’s library manager or by going to the [github repository](https://github.com/arduino-libraries/Arduino_SensorKit) |
6 | 6 |
|
| 7 | +## Classes |
| 8 | +### SensorKit |
| 9 | + |
| 10 | +#### Constructor of the object |
| 11 | + |
| 12 | +```cpp |
| 13 | +#include "Arduino_SensorKit.h" |
| 14 | + |
| 15 | +SensorKit kit; //Declare the object to use it later |
| 16 | + |
| 17 | +void setup(){} |
| 18 | +void loop(){} |
| 19 | +``` |
| 20 | + |
| 21 | +#### Initialization |
| 22 | + |
| 23 | +Using the function `begin()` at the beginning of the `setup()` |
| 24 | + |
| 25 | +```cpp |
| 26 | +#include "Arduino_SensorKit.h" |
| 27 | + |
| 28 | +SensorKit kit; //Declare the object to use it later |
| 29 | + |
| 30 | +void setup(){ |
| 31 | + kit.begin(); |
| 32 | +} |
| 33 | + |
| 34 | +void loop(){} |
| 35 | +``` |
| 36 | + |
| 37 | +### Oled |
| 38 | + |
| 39 | +Using U8G2 library |
| 40 | + |
| 41 | +### Accelerometer |
| 42 | + |
| 43 | +Using LIS3DHTR library, this library renames their functions. |
| 44 | +github.com/Seeed-Studio/Seeed_Arduino_LIS3DHTR |
| 45 | + |
| 46 | +#### Using the Accelerometer |
| 47 | + |
| 48 | +```cpp |
| 49 | +#include "Arduino_SensorKit.h" |
| 50 | + |
| 51 | +SensorKit kit; //Declare the object to use it later |
| 52 | + |
| 53 | +float acceleration; |
| 54 | + |
| 55 | +void setup(){ |
| 56 | + kit.begin(); |
| 57 | +} |
| 58 | + |
| 59 | +void loop(){ |
| 60 | + Serial.begin(9600); |
| 61 | + acceleration = Accelerometer.readX(); |
| 62 | + Serial.println(acceleration); |
| 63 | +} |
| 64 | +``` |
| 65 | + |
| 66 | +#### bool begin() |
| 67 | + |
| 68 | +Init and returns true if success, already done in the `SensorKit`'s object `begin()` |
| 69 | + |
| 70 | +#### bool available() |
| 71 | + |
| 72 | +Return if the sensor its good to give the data |
| 73 | + |
| 74 | +#### float readX() |
| 75 | + |
| 76 | +Return X axis acceleration |
| 77 | + |
| 78 | +#### float readY() |
| 79 | + |
| 80 | +Return Y axis acceleration |
| 81 | + |
| 82 | +#### float readZ() |
| 83 | + |
| 84 | +Return Z axis acceleration |
| 85 | + |
| 86 | +#### void setOutputDataRate(odr_type_t odr); |
| 87 | + |
| 88 | +### Pressure |
| 89 | +#### DHTPIN |
| 90 | +By default, once you include the library it has been set to digital pin 3, it can be changed by adding |
| 91 | +`#define DHTPIN yourPin` |
| 92 | +#### bool begin(); |
| 93 | +Init and returns true if success, already done in the `SensorKit`'s object `begin()` |
| 94 | +#### void end(); |
| 95 | + |
| 96 | +#### float readTemperature(); |
| 97 | +#### uint32_t readPressure(); |
| 98 | +#### float readAltitude(); |
| 99 | + |
| 100 | +### Environment |
| 101 | + It has DHTPIN defined by default to digital pin 3, you can redefine it by adding |
| 102 | + `#define DHTPIN yourPin` |
0 commit comments