thegadgitman Posted February 6, 2010 Share Posted February 6, 2010 I have a small project. I have a control board that is connected to the parallel port. It controls 8 strips of LED on the LPT1 port. I can turn these on and off via the command prompt, using LPTOUT.exe ie lptout 1 turns on the 1st LED lptout 2 will turn off 1st LED and turn on 2nd, lptout 4 turns on 3rd and 2nd off, etc 1, 2, 4, 8, 16, 32, 64, 128. and combinations ie lptout 3 turns on LEDS 1 and 2, and so on. However lptout seems very unresponsive sometimes I have to do lptout 1 twice before LED 1 turns on. Is there another command I can use to write to LPT1 port. I need some PHP code to control the outputs. I want to sequence the outputs ie 1on (1second) 2on (1 second) 3 on (1 second) 4 on etc. to 8, then all off then repeat. Can anyone help me. THANK YOU. Link to comment https://forums.phpfreaks.com/topic/191164-php-code-needed-to-write-to-parallel-lpt1-port/ Share on other sites More sharing options...
wkellen Posted December 30, 2010 Share Posted December 30, 2010 Did you ever figure this out? I read where you should be able to use "sleep(1);" between each command and it would put a 1 second delay before it executed each command. I haven't ever used it and might have a use for it coming up. I am curious how you accomplished this. Also I read where you can use "usleep(250000);" for a 1/4 of a second delay. Link to comment https://forums.phpfreaks.com/topic/191164-php-code-needed-to-write-to-parallel-lpt1-port/#findComment-1153163 Share on other sites More sharing options...
darth_tater Posted December 31, 2010 Share Posted December 31, 2010 Lets go over how do do the blinking first. you'll want to use pack http://php.net/manual/en/function.pack.php to take a number (say from 1- and turn it into binary. then you'll need a loop going from 1-8, calling pack with the current number that you're on, and passing that as an array / argument on to your function that writes to the parallel port. here is a link that should get you started on writing to ports in windows. http://www.governmentsecurity.org/forum/index.php?showtopic=16247 good luck! Link to comment https://forums.phpfreaks.com/topic/191164-php-code-needed-to-write-to-parallel-lpt1-port/#findComment-1153285 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.