Using PHP to control the Arduino
The following code is uploaded to an Arduino UNO R3. It listens to the serial port and
activates a digital I/O pin based on the number it received from the serial port. If it received
a "1", then it illuminates the first LED, if it receives a "2", then it illuminated the second LED,
if it receives a "3", it illuminates the third LED. The code is shown below:
The following PHP is run within an HTML page. It opens the serial port and sends data to the Arduino.