sitepoint
JavaScript Beyond the Web in 2014

preface

In the past decade, Javascript has developed very fast. With the emergence of Ajax, Node.js and other technologies, Javascript has become a first-class citizen in programming languages. Javascript can be seen in Web applications, mobile applications and Web Server. Javascript is also widely used in another area: the Internet of Things and the smart home. The most exciting thing is that you can use Javascript to control mobile phones, switch lights on and off, robots, and more.

Last year I wrote “JavaScript Beyond the Web” about the use of JavaScript in the Internet of Things. A year on, there are many new technologies and smart devices, and we’ll take a look at the use of Javascript on these smart devices.

In the past few months, the number of smart devices with Javascript interaction capabilities has increased. With the Javascript API documentation released by smart device vendors and the push of community technology, we can certainly see more and more devices with Javascript interaction capabilities.


Smart Home Products
Ninja Sphere

Ninja Sphere is the next generation of smart home controllers from Australia-based Ninja Blocks, a smart device that adds a wide variety of electronic devices to the Internet of Things and controls them one by one. Ninja Sphere is capable of remotely controlling connected devices, using gestures, seeing where they are and more. Ninja Sphere currently supports devices with Bluetooth, BLE, Wi-Fi, and Zigbee connections.


JavaScript interaction

Javascript developers can develop Ninja Sphere applications through the Ninja Sphere Node.js library, and even write device drivers and device definitions in Ninja Sphere through Javascript. This is a Javascript developer’s dream.


Leap Motion

Leap Motion is a playful little device that controls devices and apps using gestures. It can sense the natural movement of hands through the air and accurately track the movements of hands and fingers. And finger movements.


Pebble watch


  • Pebble Watch Development with JavaScript — A primer on JavaScript programming for Pebble Watch.
  • Advanced Pebble Watch Configuration — How to configure the Pebble Javascript Watch app.
  • Pebble. Js — Pebble’s official Javascript framework, currently in beta, will be released in the next few months.



Oculus Rift

The Oculus Rift is bringing us closer to virtual reality than ever before, and this year they released a new version of The machine: Crescent Bay, and their latest development Kit: The Developer Kit 2. Meanwhile, Oculus and Samsung jointly released Gear VR, a mobile VR headset that can be used with Samsung phones for VR interaction.





Babylo
n.js






Cylon


Cylon.js is a JavaScript framework for robotics and Internet of Things development. Cylon.js allows developers to use the same API to manipulate different devices, an expanding list of which includes Leap Motion, Pebble watches, Arduinos and Raspberry Pis.


Arduino YUN

Javascript interaction

  • Installing Node.js on the Arduino YUN: For Javascript developers, Linux means you can install Node.js on the Arduino and then execute Javascript code.
  • Cylon. Js module: A Cylon module that supports Arduino YUN.

Spark OS

Spark OS is a cloud-based, Internet of Things operating system. The team also owns Spark Core, an Arduino-compatible WiFi development board that allows engineers to create any hardware device connected to the network. The Spark OS cloud service allows you to send commands to the Spark Core device.

Javascript interaction

  • Official Spark JavaScript SDK: The Official JavaScript SDK.
  • Spark-ii: indicates the I/O library used to interact with the Spark device.
  • Sparky: A very simple Node.js library.
  • Cylon. Js module: A Cylon module that supports Spark OS.

Tessel

Tessel is a board similar to Arduino and Spark Core, but Tessel can run Javascript code directly and is designed almost exclusively for Javascript developers. It is fully compatible with various Packages based on Node.js and can make good use of many existing resources.

Javascript interaction

  • Official Tessel docs: Lots of examples.
  • Cylon. Js module: A Cylon module that supports Tessel.

Espruino

Espruino is a microprocessor JavaScript interpreter, claimed to be the world’s first JavaScript microcontroller for beginners or expert players, can execute your JavaScript in real time.

Javascript interaction

  • Official Espruino docs: Official documents.
  • Node-espruino: A third-party Node library that allows you to interact with Espruino via Node.js.

Intel Galileo

Intel Galileo is an Arduino development board based on x86 architecture from Intel. Like Arduino YUN, Galileo also runs Linux on the board.

Javascript interaction

  • The “bigger” Linux Image with Node.js: This article from SparkFun explains how Intel Galileo starts Linux using an SD card.
  • Intel Galileo Programming with JavaScript and Node.js: Intel Galileo Programming with JavaScript and Node.js: Intel Galileo Programming with JavaScript and Node.js
  • Cylon: Supports the Cylon module of Intel Galileo.
  • Galileo-IO Module for Johnny-Five: Javascript IO interactive module.

Google Cardboard

One of the most interesting topics at this year’s Google I/O conference was Google Cardboard. Once Cardboard is fully assembled, it can provide users with a virtual reality experience using their smartphone and a built-in pair of lenses. The official article focuses on native Android development, but you can also experience virtual reality in Chrome with Javascript.


JavaScript interaction

  • Cardboard Chrome Experiments: Includes numerous demos, as well as code examples.

Myo Armband

The Myo Armband allows you to wear it on your forearm and control your computer with movement commands. It detects gestures and electrical activity in your brain.


JavaScript interaction

  • MyoJS: An unofficial Myo Armband Javascript framework.

Nest

The Nest team now has two smart devices, Nest Thermostat and Nest Protect. This year they launched the Nest Developer Program and announced the Nest API. Although there is no documentation for the Javascript API, two sample programs that use Javascript to manipulate the Nest API are provided.

Javascript interaction

  • Official Sample JS for the Nest Thermostat: Official example.
  • Official Sample JS for the Nest Protect: Official example of smoke alarm.
  • Cylon. Js module: The Cylon module that supports Nest.



conclusion

As you can see, the number of smart devices that interact with Javascript is growing rapidly, and only the above devices are listed in this article for limited space. There’s so much more that Javascript developers can do in the Internet of Things space, so let’s start with your device!


Did this article help you? Welcome to join the front End learning Group wechat group: