Skip to content

Commit d438527

Browse files
authored
Add files via upload
1 parent e29498e commit d438527

File tree

3 files changed

+28
-17
lines changed

3 files changed

+28
-17
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Arduino Sensorkit Library
2-
3-
![](https://travis-ci.org/arduino-libraries/MKRGSM.svg?branch=master)
4-
5-
This library is for the Arduino Sensor Kit
1+
# Arduino Sensorkit Library
2+
3+
![](https://travis-ci.org/arduino-libraries/MKRGSM.svg?branch=master)
4+
5+
This library is for the Arduino Sensor Kit

examples/Pressure_Sensor/Pressure_Sensor.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
SensorKit kit;
44

5+
float pressure;
6+
57
void setup() {
68
Serial.begin(9600);
79
kit.begin();
@@ -15,7 +17,7 @@ void loop() {
1517

1618
// Get and print atmospheric pressure data
1719
Serial.print("Pressure: ");
18-
Serial.print(Pressure.readPressure());
20+
Serial.print(pressure = Pressure.readPressure());
1921
Serial.println("Pa");
2022

2123
// Get and print altitude data

examples/SensorKit_sketch/SensorKit_sketch.ino

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,40 @@
22

33
SensorKit kit;
44

5-
float temperature;
5+
int pressure;
6+
int accelX;
7+
int humidity;
68

79
void setup() {
810
// put your setup code here, to run once:
911
Serial.begin(9600);
10-
while (!Serial);
11-
Serial.println("init");
12-
1312
kit.begin();
14-
Oled.setFont(u8g2_font_ncenB08_tr); // choose a suitable font
1513
}
1614

1715
void loop() {
1816
// put your main code here, to run repeatedly:
19-
temperature = Pressure.readTemperature();
20-
Serial.println(temperature);
17+
pressure = Pressure.readPressure();
18+
accelX = Accelerometer.readX();
19+
humidity = Environment.readHumidity();
20+
21+
Serial.print("Pressure: ");
22+
Serial.println(pressure);
23+
Serial.println();
24+
25+
Serial.print("Accel X: ");
26+
Serial.println(accelX);
2127

28+
Serial.print("Humidity: ");
29+
Serial.println(humidity);
30+
2231
printScreen();
32+
delay(1000);
2333
}
2434

2535
void printScreen() {
2636
Oled.clearBuffer(); // clear the internal memory
27-
Oled.setCursor(0, 10);
28-
Oled.print(temperature); // print random value read from pin A0
29-
Oled.print(" ºC");
37+
Oled.setFont(u8g2_font_ncenB08_tr); // choose a suitable font
38+
Oled.drawStr(0, 10, "Analog Value:"); // write something to the internal memory
39+
Oled.print(pressure); // print random value read from pin A0
3040
Oled.sendBuffer(); // transfer internal memory to the display
31-
delay(1000);
3241
}

0 commit comments

Comments
 (0)