public function pulse($pin = 0, $on_ms = 120, $off_ms = 240)
{
self::validateInteger($pin, 0, 1, __FUNCTION__);
self::validateInteger($on_ms, 1, 511, __FUNCTION__);
self::validateInteger($off_ms, 1, 511, __FUNCTION__);
$this->connector->write(self::ESC . "p" . chr($pin + 48) . chr($on_ms / 2) . chr($off_ms / 2));
}
$printer->feed(); /* Tax and total */ $printer->text($tax); $printer->selectPrintMode(Printer::MODE_DOUBLE_WIDTH); $printer->text($total); $printer->selectPrintMode(); /* Footer */ $printer->feed(2); $printer->setJustification(Printer::JUSTIFY_CENTER); $printer->text("Thank you for shopping at ExampleMart\n"); $printer->text("For trading hours, please visit example.com\n"); $printer->feed(2); $printer->text($date . "\n"); /* Cut the receipt and open the cash drawer */ $printer->cut(); $printer->pulse(); $printer->close(); /* A wrapper to do organise item names & prices into columns */ class item { private $name; private $price; private $dollarSign; public function __construct($name = '', $price = '', $dollarSign = false) { $this->name = $name; $this->price = $price; $this->dollarSign = $dollarSign; } public function __toString() {