向I2C传送数据
int i2c_write(int $i2c_id, int/string $wbuf[, int $wlen = MAX_STRING_LEN])
成功时传送数据长度(byte),失败时0
<?php
include "/lib/sd_340.php";
$wbuf = "\x05\x03";
i2c_setup(0, 0x1e); // configuring I2C
$slen = i2c_write(0, $wbuf, 2); // transmitting data to the I2C
if($slen == 2)
echo "$slen bytes have been sent\r\n";
?>