Boris Bikes Update – PHP tweaks and the Finished poster
The initial php scripts that we used just outputted the following HTML code:
echo "light1=".$map_station[0]['percentage'];
echo"E\n";
echo "light2=".$map_station[1]['percentage'];
echo"E\n";
echo "light3=".$map_station[2]['percentage'];
echo"E\n";
echo "The time is:";
echo"\n";
echo time();
echo"\n";
The arduino would search through this HTML text and retrieve the integer in between “light1=” and “E” and then push it to the shift register.
Once we were happy with the circuit, Raj modified the code so that we retrieve the bike stations information, worked out how full the station is as a percentage and the mapped that value to the array below.
$lightset_conf[0]="00000000"; //Empty
$lightset_conf[1]="00100000"; //0-20%
$lightset_conf[2]="00110000"; //21-40%
$lightset_conf[3]="00111000"; //41-60%
$lightset_conf[4]="00111100"; //61-80%
$lightset_conf[5]="00111110"; //81%+
Raj
With the modifications to the PHP and the circuit mounted, we finally managed to see the full poster working.

Posted: November 5th, 2010 under Uncategorized - No Comments.














