Skip to content

Commit a2f4a95

Browse files
committed
Compatibility with Nano ESP32
1 parent c913c90 commit a2f4a95

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Modulino.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
#include <Arduino_HS300x.h>
1010
//#include <SE05X.h> // need to provide a way to change Wire object
1111

12+
#ifndef ARDUINO_API_VERSION
13+
#define PinStatus uint8_t
14+
#define HardwareI2C TwoWire
15+
#endif
16+
1217
class ModulinoClass {
1318
public:
1419
void begin(HardwareI2C& wire = Wire1) {
@@ -145,13 +150,13 @@ class ModulinoBuzzer : public Module {
145150
public:
146151
ModulinoBuzzer(uint8_t address = 0xFF)
147152
: Module(address, "BUZZER") {}
148-
void tone(size_t freq, size_t len_ms) {
153+
void (tone)(size_t freq, size_t len_ms) {
149154
uint8_t buf[8];
150155
memcpy(&buf[0], &freq, 4);
151156
memcpy(&buf[4], &len_ms, 4);
152157
write(buf, 8);
153158
}
154-
void noTone() {
159+
void (noTone)() {
155160
uint8_t buf[8];
156161
memset(&buf[0], 0, 8);
157162
write(buf, 8);

0 commit comments

Comments
 (0)