Implement I2C communication

This commit is contained in:
GHOSCHT 2022-02-05 19:15:56 +01:00
parent c5ef3d9366
commit 3740769a01
No known key found for this signature in database
GPG key ID: A35BD466B8871994
2 changed files with 15 additions and 0 deletions

View file

@ -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);
}

View file

@ -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);
};