<?php $success = i2c_open(1); printf("{$success}\n"); $result = i2c_read_byte(56); printf("result: {$result}\n"); $result = i2c_write_byte(56, 0); printf("{$result}\n");
/** * Write a value to the PCF8574. * * **WARNING!** This function does not XOR the given value. * * @param int $byte The value to write. * @return boolean|string True if the write was successful, * else an error string. */ public function direct_write($byte) { $this->open_bus_if_not_open(); return i2c_write_byte($this->addr, $byte); }