Custom Sensor Coding

Coding a Custom Sensor is an easy job here you will find the basic informations you need.

You need to know javascript.

A Custom sensor needs 2 things:

1 - a graphic interface (it can be empty but Display and Player will call a function inside your sensor code,in order to build the GUI, so that function must be there available)

2 - a main function defining the behaviour of your machine.

You will store all this informations in a file.
As far as the file is available online, it can be used in associations with other Basic or Custom Sensors created by the community.

Note that there is really no limit in the functionality of a sensor.
The sensor runs in the client browser and can perform any kind of operation, from connecting to an RSS feed, or to any API, or to perform abstract calculations or join some kind of network around the internet.

Usually a cryptosensor displays informations about cryptocurrencies, but you may have better ideas.

Before you start coding your sensor you need to understand how easy and simple is Display.
Since cryptosensor has no memory, the only way to save a layout built in Display is to store its informations in the URL. In few words a URL with the right parameters will initiate a specific set of Sensors.
Your Custom Sensor uses a special coding for Display and Player, different from default Sensors.
Play a couple minutes with the basic codes and then start your first Custom Sensor!

Coding for a Custom Sensor:

5-code

5
Sensor Type

code
needed to find the sensor code remotely

Examples:



Hello World!
Loads a panel and writes on it Hello world!
http://cryptosensor.overgrid.com/display.html?s=5-j9k4FHwT

5-j9k4FHwT

--------------------------------------------------------------------------------------

Counter
Loads a panel and writes on it a counter, refreshing every 5 seconds.
You can start and stop the counter with 2 buttons.
http://cryptosensor.overgrid.com/display.html?s=5-9fhzTRsd

5-9fhzTRsd

--------------------------------------------------------------------------------------

Player
Loads a panel with a button. The button plays a sound.
http://cryptosensor.overgrid.com/display.html?s=5-gFUOcds

5-gFUOcds

--------------------------------------------------------------------------------------

Switch
Loads a panel with a button and a led light. The button turns on and off the led.
http://cryptosensor.overgrid.com/display.html?s=5-ZxOcFx

5-ZxOcFx

--------------------------------------------------------------------------------------

Load
Loads a text from pastee.ee and prints it on a panel
http://cryptosensor.overgrid.com/display.html?s=5-pQRstu

5-pQRstu