Get started with Protobject

Preliminary settings


You need a smartphone and a stable support for it such as a trippod in addition to a selfie stick.

Protobject works properly only if smartphones are stably fixed. Therefore a stable support for the smartphone must be used.


Install Protobject app for Android.

This application lets you use the camera of your smartphone with Protobject.


Place the smartphone torward the object you want to detect and start the Protobject smartphone app.

Finally, download Protobject desktop app for Windows and connect the smartphone (see next step) through its IP Address (e.g., 192.168.43.1).

Sense object states with Protobject

You will learn to use the basic functions of Protobject (desktop app) in just two minutes watching the following video.

We encourage you to do exactly what the video shows to get practice with Protobject (all you need is a table lamp).

After capturing the states of Lamp and Plug, you can use them to design your app using Protobject IDE (included with Protobject).

 

Design your app

You can leverage states given by Protobject as input for prototyping to code your smart apps using JavaScript, the language used by Protobject IDE.

The following code uses the configuration of the Lamp/Plug displayed in the previous step. The code is self-explaining.

function appConfig() {
 app.setWindowTitle("My first Protobject app"); //change if you want
 app.setWindowSize(640,480); //change if you want
}

function appBody() {
 //when the state of the lamp changes
 protobject.onEvent("Lamp", function(e) { 
 console.log("The state of the lamp is: "+e.detail.state);
 });

//when the plug is plugged
 protobject.onEvent("Plug.Plugged", function(e) { 
 console.log("The plug of the lamp was plugged.");
 }); 
}

Do you want to make something awesome? See other examples.