Skip to content

Commit 794e2ff

Browse files
authored
backup
1 parent d438527 commit 794e2ff

File tree

3 files changed

+17
-28
lines changed

3 files changed

+17
-28
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: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
SensorKit kit;
44

5-
float pressure;
6-
75
void setup() {
86
Serial.begin(9600);
97
kit.begin();
@@ -17,7 +15,7 @@ void loop() {
1715

1816
// Get and print atmospheric pressure data
1917
Serial.print("Pressure: ");
20-
Serial.print(pressure = Pressure.readPressure());
18+
Serial.print(Pressure.readPressure());
2119
Serial.println("Pa");
2220

2321
// Get and print altitude data

examples/SensorKit_sketch/SensorKit_sketch.ino

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

33
SensorKit kit;
44

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

97
void setup() {
108
// put your setup code here, to run once:
119
Serial.begin(9600);
10+
while (!Serial);
11+
Serial.println("init");
12+
1213
kit.begin();
14+
Oled.setFont(u8g2_font_ncenB08_tr); // choose a suitable font
1315
}
1416

1517
void loop() {
1618
// put your main code here, to run repeatedly:
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);
19+
temperature = Pressure.readTemperature();
20+
Serial.println(temperature);
2721

28-
Serial.print("Humidity: ");
29-
Serial.println(humidity);
30-
3122
printScreen();
32-
delay(1000);
3323
}
3424

3525
void printScreen() {
3626
Oled.clearBuffer(); // clear the internal memory
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
27+
Oled.setCursor(0, 10);
28+
Oled.print(temperature); // print random value read from pin A0
29+
Oled.print(" ºC");
4030
Oled.sendBuffer(); // transfer internal memory to the display
31+
delay(1000);
4132
}

0 commit comments

Comments
 (0)