Skip to content

Commit 1c6a6f5

Browse files
committed
bug fix
1 parent 1dfc473 commit 1c6a6f5

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

examples/TemperatureAlert/TemperatureAlert.ino

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
Nano 33 BLE Sense. If the temperature increases above a certain limit, it turns the buzzer on.
55
The circuit:
66
- Arduino Nano 33 BLE Sense
7-
- Active buzzer module connected at pin 9
7+
- Active buzzer module connected to pin 9 and GND
88
99
written by K.Abhijeet
1010
This example code is in the public domain
1111
*/
1212

1313
#include <Arduino_HTS221.h>
1414

15-
float tempLimit = 37; // set your temperature limit in °C
15+
float tempLimit = 37; // set your temperature limit in °C
1616

1717
void setup() {
1818
Serial.begin(9600);
@@ -28,13 +28,13 @@ void setup() {
2828

2929
void loop() {
3030

31-
float temperature = HTS.readTemperature(); // read the sensor value
31+
float temperature = HTS.readTemperature(); // read the sensor value
3232

33-
Serial.print("Temperature = "); // print the sensor value
33+
Serial.print("Temperature = "); // print the sensor value
3434
Serial.print(temperature);
3535
Serial.println(" °C");
3636

37-
if (temperature > tempLimit)
37+
if (temperature > tempLimit)
3838
{
3939
digitalWrite(9, HIGH);
4040
delay(500);
@@ -43,7 +43,6 @@ void loop() {
4343
}
4444
else
4545
{
46-
delay(2000); // wait a while before displaying the next reading If the temperature is below the limit
46+
delay(2000); // wait a while before displaying the next reading If the temperature is below the limit
4747
}
48-
4948
}

0 commit comments

Comments
 (0)