Login   Register  
PHP Classes
elePHPant
Icontem

File: example_lpt.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Luis Martinez Ulloa  >  Linux PC ports  >  example_lpt.php  >  Download  
File: example_lpt.php
Role: Example script
Content type: text/plain
Description: example: switch control port of lp0(LPT1)
Class: Linux PC ports
Read and write data to computer I/O ports on Linux
Author: By
Last change: Change include path
Date: 2010-03-11 12:27
Size: 334 bytes
 

Contents

Class file image Download
<?php

//acceso a los puertos por php y /dev/port
//debe iniciarse como root
//sudo php example_lpt.php

require_once 'xzyports.php';

$io = new xzyports;
for(
$cont 0$cont 20$cont++) {
    echo 
"$cont\n";
    
$io->outp(0x37a,255);
    
sleep(3);
    echo 
"down\n";
    
$io->outp(0x37a,0);
    
sleep(3);
}
echo 
"***fin***\n";
?>