99) $number=99; if ($number < 50) { // blue to green $g = floor(255 * ($number / 50)); $b = 120; $r = 0; } else { // green to yelow $r = 255; $g = floor(255 * ((50-$number%50) / 50)); $b = 0; } return sprintf("%02X%02X%02X",$r,$g,$b); } function printSDR($fil){ if (($handle = fopen($fil, "r")) !== FALSE) { $line = fgets($handle); echo ""; $line = fgets($handle); echo ""; $line = fgets($handle); echo "
Freq:".$line{2}.$line{3}.$line{4}.".".$line{5}.$line{6}.$line{7}." MHzPPM:".$line{2}.$line{3}."Gain:".$line{2}.$line{3}."

"; echo ""; while (($line = fgets($handle)) !== false) { $arr = explode(";",$line); echo ""; $p=ord($line{16}); echo ""; for($i=0;$i<16;$i++){ $p=ord($line{$i+16}); echo ''; } echo ""; } echo "
".$line{0}.$line{1}." : ".$line{3}.$line{4}.$line{5}.".".$line{6}.$line{7}.$line{8}." MHz".intval($arr[2])."kHz (".$p."dB) 
"; } else echo "NO SDR"; } echo ""; echo "
SDR #1SDR #2
"; printSDR("/tmp/sdr1.bin"); echo ""; printSDR("/tmp/sdr2.bin"); echo "


SDR #3SDR#4
"; printSDR("/tmp/sdr3.bin"); echo ""; printSDR("/tmp/sdr4.bin"); echo "
"; ?>