Functions
Leds and buttons

Additional documentation for group 'Leds and buttons'. This file contains functions to control leds and buttons using a port expander. More...

Functions

void expanderWrite (unsigned char _data)
byte expanderRead ()
char Button1 ()
char Button2 ()
char Button3 ()
char Button4 ()
char Led1 (char state)
char Led2 (char state)
char Led3 (char state)
char Led4 (char state)
void ISR_Interrupt ()

Detailed Description

Additional documentation for group 'Leds and buttons'. This file contains functions to control leds and buttons using a port expander.

See also :

pcf8574.h
Here is a link to the Header File Reference.
pcf8574.cpp
Here is a link to the C++ File Reference.


Function Documentation

char Button1 ( )

Reads the state of button 1.

Returns:
1 means button is pressed, 0 button is not pressed, from -1 to -4 transmission error and -5 means time out occurence.

Definition at line 58 of file pcf8574.cpp.

char Button2 ( )

Reads the state of button 2.

Returns:
1 means button is pressed, 0 button is not pressed, from -1 to -4 transmission error and -5 means time out occurence.

Definition at line 90 of file pcf8574.cpp.

char Button3 ( )

Reads the state of button 3.

Returns:
1 means button is pressed, 0 button is not pressed, from -1 to -4 transmission error and -5 means time out occurence.

Definition at line 107 of file pcf8574.cpp.

char Button4 ( )

Reads the state of button 4.

Returns:
1 means button is pressed, 0 button is not pressed, from -1 to -4 transmission error and -5 means time out occurence.

Definition at line 124 of file pcf8574.cpp.

byte expanderRead ( )

Reads the pins on the port expander.

Returns:
a byte of data.
void expanderWrite ( unsigned char  _data)

Sets the pins to high or low.

Parameters:
_dataData to write. Write bit is 0 and read bit is 1.
Returns:
no return.

Definition at line 13 of file pcf8574.cpp.

void ISR_Interrupt ( )

Interrupt function for reception mode of the port expander.

Returns:
no return.

Definition at line 247 of file pcf8574.cpp.

char Led1 ( char  state)

Sets the state of the led 1.

Parameters:
state1 is ON and 0 is OFF.
Returns:
1 means button is pressed, 0 button is not pressed, from -1 to -4 transmission error.

Definition at line 150 of file pcf8574.cpp.

char Led2 ( char  state)

Sets the state of the led 2.

Parameters:
state1 is ON and 0 is OFF.
Returns:
1 means button is pressed, 0 button is not pressed, from -1 to -4 transmission error.

Definition at line 169 of file pcf8574.cpp.

char Led3 ( char  state)

Sets the state of the led 3.

Parameters:
state1 is ON and 0 is OFF.
Returns:
1 means button is pressed, 0 button is not pressed, from -1 to -4 transmission error.

Definition at line 188 of file pcf8574.cpp.

char Led4 ( char  state)

Sets the state of the led 4.

Parameters:
state1 is ON and 0 is OFF.
Returns:
1 means button is pressed, 0 button is not pressed, from -1 to -4 transmission error.

Definition at line 207 of file pcf8574.cpp.