An arduino library to communicate using the Dallas one-wire protocol, where the Arduino takes the role of a slave. Implementation of a DS2413 on Arduino UNO and ATTINY85
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
675 B

#ifndef _SerialChannel_h_
#define _SerialChannel_h_
class SerialChannel
{
private:
static SerialChannel* first;
SerialChannel* next;
static byte nextId;
byte id;
const char* name;
public:
SerialChannel(const char* name_);
void write(byte* data, short byteCount, unsigned long time = (unsigned long)-1);
void write(const char* text, unsigned long time = (unsigned long)-1);
void beginWrite(short byteCount, unsigned long time = (unsigned long)-1);
void continueWrite(byte* data, short byteCount);
private:
void handleConnection();
void writeShort(short num);
void writeULong(unsigned long num);
};
#endif