Skip to content

Commit

Permalink
Merge pull request #6 from vgheo/master
Browse files Browse the repository at this point in the history
move Wire.begin() call in user code; Load example in Arduino IDE
  • Loading branch information
thakshak committed Nov 25, 2016
2 parents bacb93b + b42df31 commit ddaabaf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 0 additions & 1 deletion AM2320/AM2320.cpp
Expand Up @@ -23,7 +23,6 @@ unsigned int CRC16(byte *ptr, byte length)

AM2320::AM2320()
{
Wire.begin();
}

int AM2320::Read()
Expand Down
@@ -1,9 +1,11 @@
#include <Wire.h>
#include <AM2320.h>

AM2320 th;

void setup() {
Serial.begin(9600);
Wire.begin();
}

void loop() {
Expand Down
7 changes: 7 additions & 0 deletions README.md
Expand Up @@ -2,3 +2,10 @@
Ten AM2320 i2c temperature and humidity sensor arduino library.
Just, implemented basic temperature and humidity values reading.
NOTE: user written code should include the wire.h library.

Wire.begin() is expected to be called before any call to AM2320::Read().
(eg. in the sketch setup() function).


Note: Tested on ESP8266/Arduino.

0 comments on commit ddaabaf

Please sign in to comment.