Here is my driver for running a PCF8574. Has functions defined for turning on or off any single pin on the chip, writing binary numbers to the device, or reading all or one pins I/O state. Also has error function in case the chip does not receive or respond to a write command.

// Turn on a pin, nothing will happen if already on// Does not affecting already on or off pins// Use number 1-8 for PinNumbervoid PCF8574PinOn (const tSensors SensorPort, byte PinNumber ){ byte HardwareBefore; byte MessageToSend;

// Turn off a pin, nothing will happen if already off// Does not affecting already on or off pins// Use number 1-8 for PinNumbervoid PCF8574PinOff (const tSensors SensorPort, byte PinNumber ){ byte HardwareBefore; byte MessageToSend;

// Turn on or off a single pin, off if already on, on if already off// Does not affecting already on or off pins// Use number 1-8 for PinNumbervoid PCF8574PinOnOff (const tSensors SensorPort, byte PinNumber ){ byte HardwareBefore; byte MessageToSend;

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum