Skip to content

Commit

Permalink
Support Arduino and ESP
Browse files Browse the repository at this point in the history
  • Loading branch information
hibikiledo committed Mar 30, 2020
1 parent 842ae26 commit a841d38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions AM2320.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ void AM2320::begin() {
Wire.begin();
}

#if defined(ESP8266)
void AM2320::begin(int sda, int scl) {
Wire.begin(sda, scl);
}
#endif

float AM2320::getTemperature() {
return _temperature;
Expand Down
4 changes: 3 additions & 1 deletion AM2320.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ class AM2320 {
public:
AM2320();

// initialize AM2320
void begin();

#if defined(ESP8266)
void begin(int sda, int scl);
#endif

bool measure();

Expand Down

0 comments on commit a841d38

Please sign in to comment.