-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPCF8574.h
52 lines (42 loc) · 785 Bytes
/
PCF8574.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//
// FILE: PCF8574.H
// AUTHOR: Rob Tillaart
// DATE: 02-febr-2013
// VERSION: 0.1.02
// PURPOSE: I2C PCF8574 library for Arduino
// URL:
//
// HISTORY:
// see PCF8574.cpp file
//
#ifndef _PCF8574_H
#define _PCF8574_H
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#define PCF8574_LIB_VERSION "0.1.02"
class PCF8574
{
public:
PCF8574(int address);
void begin();
uint8_t read8();
uint8_t read(uint8_t pin);
uint8_t value();
void write8(uint8_t value);
void write(uint8_t pin, uint8_t value);
void toggle(uint8_t pin);
void shiftRight(uint8_t n=1);
void shiftLeft(uint8_t n=1);
int lastError();
private:
int _address;
uint8_t _data;
int _error;
};
#endif
//
// END OF FILE
//