Skip to content
This repository was archived by the owner on May 27, 2020. It is now read-only.

Commit 1ef6be9

Browse files
author
Toni Klopfenstein
committed
Updating firmware files, fixing naming issues
1 parent 021921d commit 1ef6be9

File tree

8 files changed

+85
-5
lines changed

8 files changed

+85
-5
lines changed

Libraries/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ Distributed as-is; no warranty is given.
1919

2020
- Your friends at SparkFun.
2121

22-
BUILD INSTRUCTIONS
22+
Update Library Instructions:
23+
----------------------------
24+
To get the most up-to-date version of the library, you must run the following git subtree commands.
2325

24-
$git subtree add -P DIRECTORY NAME --squash git repo URL ref
25-
26-
$git subtree pull -P DIRECTORY NAME --squash git repo URL ref
26+
$git subtree pull -P Libraries/Arduino --squash https://github.com/sparkfun/SparkFun_HTU21D_Breakout_Arduino_Library.git master
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
2+
/*
3+
HTU21D Simple Sketch demo
4+
Dave@sparkfun
5+
SparkFun Electronics
6+
License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).
7+
8+
Get humidity and temperature from the HTU21D sensor.
9+
10+
Hardware Connections (Breakoutboard to Arduino):
11+
-VCC = 3.3V
12+
-GND = GND
13+
-SDA = A4
14+
-SCL = A5
15+
16+
Serial.print it out at 9600 baud to serial monitor.
17+
*/
18+
19+
#include <Wire.h>
20+
#include <SparkFunHTU21D.h>
21+
#include <SoftwareSerial.h>
22+
23+
SoftwareSerial display(3, 2);
24+
25+
//Create an instance of the object
26+
HTU21D myHumidity;
27+
28+
char humstring[10];
29+
char tmpstring[10];
30+
31+
float humidity;
32+
float temperature;
33+
34+
int ihum;
35+
int itemp;
36+
37+
void setup()
38+
{
39+
Wire.begin(); // Join i2c bus
40+
Serial.begin(9600); // Start serial for output
41+
42+
myHumidity.begin(); // Get sensor online
43+
44+
display.begin(9600);
45+
Serial.begin(9600);
46+
delay(500);
47+
48+
display.write(254); // move cursor to beginning of first line
49+
display.write(128);
50+
51+
display.write(" "); // clear display
52+
display.write(" ");
53+
}
54+
55+
void loop()
56+
{
57+
humidity = myHumidity.readHumidity();
58+
ihum = humidity;
59+
sprintf(humstring, "%2d", ihum);
60+
61+
Serial.print("Humidity: ");
62+
Serial.println(humstring);
63+
Serial.print("%");
64+
65+
display.write("Humidity: ");
66+
display.write(humstring);
67+
68+
display.write(254); // move cursor to beginning of first line
69+
display.write(128);
70+
71+
delay(250);
72+
}
73+

firmware/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
SparkFun HTU21D Firmware
2+
===================================
3+
4+
* **HTU21D_SimpleSketch** - Arduino simple sketch example. See video [here](https://youtu.be/HfNsybUKU6U).
5+
* **SparkFun_HTU21D_Example** - Arduino example sketch for getting started. No library required.
6+
7+
File renamed without changes.
File renamed without changes.
File renamed without changes.

library/HTU21D_Humidity/examples/Humidity/Humidity.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
#include <Wire.h>
21-
#include "HTU21D.h"
21+
#include "SparkFunHTU21D.h"
2222

2323
//Create an instance of the object
2424
HTU21D myHumidity;

0 commit comments

Comments
 (0)