Skip to content

Commit 6a6ed3d

Browse files
committed
Adding overloads for other integer types in Wire.write(). (Paul Stoffregen)
http://code.google.com/p/arduino/issues/detail?id=527
1 parent 6fa5f18 commit 6a6ed3d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libraries/Wire/Wire.h

+4
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ class TwoWire : public Stream
6161
void onReceive( void (*)(int) );
6262
void onRequest( void (*)(void) );
6363

64+
inline size_t write(unsigned long n) { return write((uint8_t)n); }
65+
inline size_t write(long n) { return write((uint8_t)n); }
66+
inline size_t write(unsigned int n) { return write((uint8_t)n); }
67+
inline size_t write(int n) { return write((uint8_t)n); }
6468
using Print::write;
6569
};
6670

0 commit comments

Comments
 (0)