Microsoft Windows* 8.x

Creating a web server

This sample creates a very simple web server on the IoT device using the libmraa and libupm libraries for Node.js*. The code uses the light sensor from the Grove* - Starter Kit Plus and serves JSON with the value read together with a simple-minded conversion to lux using linear interpolation.

Entering command line arguments for your IoT application

You can enter command line arguments for use in your IoT application. This provides you with a simple way to input arguments for your code to use. For example, if you have a temperature monitoring application, you can type an argument like -f or -c and have your program change its output to Fahrenheit or Celsius accordingly.

As another example, the following code in your main.js file would output each command line argument to the console, along with an index number:

Updating the libmraa and libupm libraries

The Intel® IoT Developer Kit makes use of the libmraa and libupm libraries. libmraa, also called the MRAA I/O library, provides you with a platform-independent way of accessing the peripherals connected to your development board. libupm, also called the UPM sensory library, provides you with sensor representations to communicate with GPIO pins. For more information on these libraries, see the examples that are available in the Intel XDK IoT Edition, as well as the documentation at:

Interacting with GPIOs using the MRAA I/O library

You can use the MRAA I/O library, also called libmraa, to access and manipulate the basic capabilities of your board. While UPM is a library that uses MRAA to create sensor representations, MRAA is a low-level library written in the C language and serves as a translation layer on top of the Linux* general purpose input/output (GPIO) facilities. MRAA makes developing programs less complicated because it can be used to create platform-independent code.

Iscriversi a Microsoft Windows* 8.x