Internet Controlled Arduino LED via USB


In order to have an Arduino controlled by a web page without the use of an Ethernet Shield, it will require the use of multiple programming languages; HTML, CSS, JS, PHP, Processing, Arduino. in this example we created a web page using php that writes a 1 or a 2 to a text file saved on the web server. This will indicate if the switch has been set to on or off. A Processing Sketch then reads this file and prints the number to the local communications port. The Arduino (connected via USB) then reads this number from the port and controls the LED based on the number read from the port.

HTML / PHP

See the Pen Internet Controlled Arduino LED by Troy Finamore (@findes) on CodePen.

Processing Sketch

See the Pen Internet Controlled Arduino LED by Troy Finamore (@findes) on CodePen.

Arduino Sketch

See the Pen Internet Controlled Arduino LED by Troy Finamore (@findes) on CodePen.

Back to Top