![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Control Code with I/O and ADC working
Diff: MCP23008/MCP23008.h
- Revision:
- 21:f87464a7e7c6
- Parent:
- 1:0182b86f9bd4
--- a/MCP23008/MCP23008.h Mon Jul 16 03:53:59 2018 +0000 +++ b/MCP23008/MCP23008.h Wed Jul 18 21:28:45 2018 +0000 @@ -1,5 +1,5 @@ #include "mbed.h" - + class MCP23008 { public: @@ -11,41 +11,41 @@ * value that is physically set via A0, A1, and A2. * @param freq The I2C frequency. */ - + MCP23008(PinName sda, PinName scl, uint8_t address, int freq); - + /** Setup the port direction of each of the pins * */ - + void init(); - - + + /** Write to the output pins. * * This function is used to set output pins on or off. * * @param val The GPIO channels to turn on */ - - void writeOutput(int chn1, int chn2, int chn3, int chn4); - - + + int writeOutput(int chn1, int chn2, int chn3, int chn4); + + /** Sets I2C address * * This function is used to set the I2C address * * @param address The I2C address */ - + void setAddress(int address); - + private: I2C i2c; - - uint8_t addrI2C; - + + uint8_t addrI2C; + uint8_t GPIO_Pin_Status; }; - +