Implement I2C communication
This commit is contained in:
parent
c5ef3d9366
commit
3740769a01
2 changed files with 15 additions and 0 deletions
|
@ -0,0 +1,7 @@
|
||||||
|
#include <I2CCommunicator.h>
|
||||||
|
#include <Wire.h>
|
||||||
|
|
||||||
|
I2CCommunicator::I2CCommunicator(TwoWire &w_out, int slaveAddr, int timeout, __SIZE_TYPE__ bufferSize) : StreamCommunicator(w_out, bufferSize)
|
||||||
|
{
|
||||||
|
w_out.begin(slaveAddr);
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
#include <StreamCommunicator.h>
|
||||||
|
#include <Wire.h>
|
||||||
|
|
||||||
|
class I2CCommunicator : public StreamCommunicator
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
I2CCommunicator(TwoWire &w_out, int slaveAddr, int timeout, __SIZE_TYPE__ bufferSize);
|
||||||
|
};
|
Reference in a new issue