PHP, Adaptive LED Signs, and You
I'd like to provide a small example of interfacing with an Adaptive Alpha LED display bar via RS232. In this case, I'm working with an Alpha 215R although it should also work with anything else in the Alpha 200 series.
My reason for doing this was to provide a way for Winamp to update the Alpha sign with 'Now Playing' information. I plan to provide steps to accomplish that in a bit. For now, I'm just posting the code for com port communication.
PHP:
-
<?
-
// We need to make sure the local text file is updated before we run the script.
-
// So, I'm putting a 1 second pause here to make sure winamp has updated the nowPlaying.txt file.
-
-
-
// Set com port mode to match ALPHA 215R settings.
-
$set_mode = "MODE COM1: BAUD=9600 PARITY=E DATA=7 STOP=1 TO=ON XON=OFF ODSR=ON OCTS=ON DTR=ON RTS=ON IDSR=ON";
-
//Uncomment the following line to debug MODE settings.
-
//print_r($output);
-
-
#check exit status from MODE command
-
switch ($result) {
-
case 0 :
-
break;
-
default :
-
exit;
-
}
-
-
// Open the com port to write to
-
-
if(!$fp)
-
{
-
return;
-
}
-
-
// Read in 'now playing' information.
-
$sNowPlaying = $aNowPlaying[0];
-
-
// send control codes to copy a new TEXT line onto the display.
-
// This is the point where you'd want to consult the alpha manual
-
// for setting up all the display options you need.
-
// Refer to Alpha document 9708-8061E
-
-
-
?>
-- MrBlaQ