@@ -95,12 +95,12 @@ Initialize the sensor
95
95
96
96
float x,y,z; // Values for the readings
97
97
98
- setup (){
98
+ void setup (){
99
99
Serial.begin(9600);
100
100
Accelerometer.begin();
101
101
}
102
102
103
- loop{
103
+ void loop() {
104
104
x = Accelerometer.readX();
105
105
y = Accelerometer.readY();
106
106
z = Accelerometer.readZ();
@@ -120,12 +120,12 @@ Return if the sensor its good to give the data
120
120
121
121
float x,y,z; // Values for the readings
122
122
123
- setup(){
123
+ void setup(){
124
124
Serial.begin(9600);
125
125
Accelerometer.begin();
126
126
}
127
127
128
- loop{
128
+ void loop() {
129
129
if(Accelerometer.available()){
130
130
x = Accelerometer.readX();
131
131
Serial.print("X axis: "); Serial.println(x);
@@ -153,15 +153,14 @@ Initialize the sensor
153
153
154
154
float temperature; // Value for the reading
155
155
156
- setup(){
156
+ void setup(){
157
157
Serial.begin(9600);
158
158
Pressure.begin();
159
159
}
160
160
161
- loop{
161
+ void loop() {
162
162
temperature = Pressure.readTemperature();
163
163
Serial.print("temperature :"); Serial.println(temperature);
164
- }
165
164
}
166
165
```
167
166
@@ -172,15 +171,14 @@ Initialize the sensor
172
171
173
172
uint32_t pressure; // Value for the reading
174
173
175
- setup (){
174
+ void setup (){
176
175
Serial.begin(9600);
177
176
Pressure.begin();
178
177
}
179
178
180
- loop{
179
+ void loop() {
181
180
pressure = Pressure.readPressure();
182
181
Serial.print("pressure :"); Serial.println(pressure);
183
- }
184
182
}
185
183
```
186
184
@@ -190,15 +188,14 @@ Initialize the sensor
190
188
191
189
float altitude; // Value for the reading
192
190
193
- setup(){
191
+ void setup(){
194
192
Serial.begin(9600);
195
- Presure .begin();
193
+ Pressure .begin();
196
194
}
197
195
198
- loop{
196
+ void loop() {
199
197
altitude = Pressure.readAltitude();
200
198
Serial.print("altitude :"); Serial.println(altitude);
201
- }
202
199
}
203
200
```
204
201
0 commit comments