Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: I2CDriver/I2CDriver.cpp
- Revision:
- 2:f2700008c9d9
- Parent:
- 1:53b8c6b13010
- Child:
- 3:da30c350c339
--- a/I2CDriver/I2CDriver.cpp Wed Apr 30 11:49:26 2014 +0000
+++ b/I2CDriver/I2CDriver.cpp Thu May 01 20:58:59 2014 +0000
@@ -0,0 +1,14 @@
+#include "I2CDriver.h"
+#include "mbed.h"
+
+I2CDriver::I2CDriver(PinName pin1, PinName pin2, const char addr) : slave(pin1, pin2){
+ slave.address(addr);
+}
+
+uint8_t I2CDriver::read(void){
+ return slave.read();
+}
+
+int I2CDriver::receive(void){
+ return slave.receive();
+}
\ No newline at end of file