Esempio n. 1
0
<?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");
Esempio n. 2
0
 /**
  * Open the i2c bus if it's not already open.
  *
  * @return void
  */
 private function open_bus_if_not_open()
 {
     if ($this->is_bus_open !== true) {
         $this->is_bus_open = i2c_open($this->bus) === true;
     }
 }