Add syntax declaration to code block in README.md

pull/1/head
John Long 11 years ago
parent ad507ed46c
commit 9ef8e72f3e
  1. 30
      README.md

@ -19,17 +19,19 @@ Features
Example
-------
// Modbus master UDP
$modbus = new ModbusMaster("192.168.1.1", "UDP");
// Read multiple registers
try {
$recData = $modbus->readMultipleRegisters(0, 12288, 5);
}
catch (Exception $e) {
// Print error information if any
echo $modbus;
echo $e;
exit;
}
// Print data in string format
echo PhpType::bytes2string($recData);
```php
// Modbus master UDP
$modbus = new ModbusMaster("192.168.1.1", "UDP");
// Read multiple registers
try {
$recData = $modbus->readMultipleRegisters(0, 12288, 5);
}
catch (Exception $e) {
// Print error information if any
echo $modbus;
echo $e;
exit;
}
// Print data in string format
echo PhpType::bytes2string($recData);
```

Loading…
Cancel
Save