> 4 ) & 15) << 4) ^ $d; fputs($PIO,$HighNibble); fputs($PIO,$LowNibble); } function LCD_TextOut($text) { $y = strlen($text); for ($x=0; $x < $y; $x++) { Command8(ord($text[$x]),false); } } function LCD_ClrScr() { Command8(1,true); } function LCD_Init() { echo "Initializing LCD\n"; system('printf "1">strobe'); Control4(3); Control4(3); Control4(3); Control4(2); // function set Control4(2); Control4(8); // display off Command8(8,true); // display on Command8(15,true); //entry mode Command8(6,true); // clear screen Command8(1,true); //cursor home Command8(2,true); } function LCD_RowCol($row,$col) { if ($row == 1) { $outb = 128; } if ($row == 2) { $outb = 192; } $outb=$outb+$col-1; echo $outb."\n"; Command8($outb,true); } LCD_Init(); Command8(8,true); LCD_TextOut("Testing"); Command8(15,true); LCD_RowCol(2,1); LCD_TextOut("Protocol reimpl."); ?>