Skip to content

Commit ebaab30

Browse files
authored
Update readme.md
1 parent e3b1c37 commit ebaab30

File tree

1 file changed

+60
-16
lines changed

1 file changed

+60
-16
lines changed

docs/readme.md

Lines changed: 60 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This is a basic documentation about the library for the *SensorKit* .
44

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)
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)
66

77
## Classes
88
### SensorKit
@@ -37,13 +37,62 @@ Using the function `begin()` at the beginning of the `setup()`
3737
### Oled
3838
3939
Using U8G2 library
40+
https://github.com/olikraus/u8g2
4041
42+
#### Init the driver
43+
44+
Init and returns true if success, already done in the `SensorKit`'s object `begin()`
45+
46+
```cpp
47+
if(!Oled.begin()){
48+
Serial.println("Error");
49+
while(1);
50+
}
51+
Serial.println("Ok");
52+
```
53+
#### "hello world" screen
54+
```cpp
55+
#include "Arduino_SensorKit.h"
56+
57+
SensorKit kit;
58+
59+
void setup() {
60+
kit.begin();
61+
}
62+
63+
void loop() {
64+
Oled.clearBuffer(); // clear the internal memory
65+
Oled.setFont(u8g2_font_ncenB08_tr); // choose a suitable font
66+
Oled.setCursor(0, 10);
67+
Oled.print("Hello World"); // write something to the internal memory
68+
Oled.sendBuffer(); // transfer internal memory to the display
69+
delay(1000);
70+
}
71+
```
72+
73+
#### Print values
74+
Syntax:
75+
```cpp
76+
Oled.print(value);
77+
```
4178
### Accelerometer
4279

4380
Using LIS3DHTR library, this library renames their functions.
4481
github.com/Seeed-Studio/Seeed_Arduino_LIS3DHTR
45-
46-
#### Using the Accelerometer
82+
83+
84+
#### Init the sensor
85+
86+
Init and returns true if success, already done in the `SensorKit`'s object `begin()`
87+
```cpp
88+
if (!Accelerometer.begin()){
89+
Serial.println("Error"); // Accelerometer didnt initialized
90+
while(1); // Stop the program
91+
}
92+
Serial.println("Init complete");
93+
```
94+
95+
#### Read Acceleration X
4796
4897
```cpp
4998
#include "Arduino_SensorKit.h"
@@ -63,17 +112,6 @@ github.com/Seeed-Studio/Seeed_Arduino_LIS3DHTR
63112
}
64113
```
65114

66-
#### Init the sensor
67-
68-
Init and returns true if success, already done in the `SensorKit`'s object `begin()`
69-
```cpp
70-
if (!Accelerometer.begin()){
71-
Serial.println("Error"); // Accelerometer didnt initialized
72-
while(1); // Stop the program
73-
}
74-
Serial.println("Init complete");
75-
```
76-
77115
#### Read values
78116
```cpp
79117
#include "Arduino_SensorKit.h"
@@ -121,6 +159,8 @@ Return if the sensor its good to give the data
121159
```
122160
123161
### Pressure
162+
Using BMP280 library
163+
https://github.com/Seeed-Studio/Grove_BMP280
124164

125165
#### Init the sensor
126166
Init and returns true if success, already done in the `SensorKit`'s object `begin()`
@@ -173,7 +213,6 @@ The Pressure sensor can get temperature, pressure and altitude
173213
}
174214
```
175215
176-
177216
##### Altitude
178217
```cpp
179218
#include "Arduino_SensorKit.h"
@@ -194,10 +233,15 @@ The Pressure sensor can get temperature, pressure and altitude
194233
```
195234
196235
### Environment
236+
Using DHT library
237+
https://github.com/adafruit/DHT-sensor-library
238+
197239
DHT sensor can read Temperature and Humidity
198240
#### DHTPIN
199241
By default, once you include the library it has been set to digital pin `3`, it can be changed by adding
200-
`#define DHTPIN yourPin`
242+
```cpp
243+
#define DHTPIN yourPin
244+
```
201245
202246
#### Init the sensor
203247
```cpp

0 commit comments

Comments
 (0)