I started with the simple task to make LEDs blink, and then after basics, I had started wondering how to control them remotely. So here is what I have come up with.

I am using here PubNub Data Stream Network and Johnny-Five, an open-source JavaScript robotics framework that lets you program an Arduino with Node.js. The LEDs are remotely controlled via a web portal.

Remote controller code:

See the Pen Remote control for Arduino #2 by Roman Trilo (@romantrilo) on CodePen.

Code:

See the Pen blink-remote.js by Roman Trilo (@romantrilo) on CodePen.

Result:

Reference:
https://create.arduino.cc/…/getting-started-with-johnny-five-for-iot-part-2-1278f7