There are a few headline things that you need to know:
//store foo context.set("foo", myvalue) //retrieve foo var myvalue = context.get("foo") || adefaultvalue
Several nodes need to know the ‘shape’ of data that they are receiving as input (e.g. uibuilder). If the function node sends data to one of these nodes, then it has to specify its schema. The node will try and do this automatically, but you may need to add further detail.
If you connect the input and output nodes to a dbfunction before you write code, you can get the node to create skeleton code to ensure that the inputs and outputs conform to what is expected.
The following tutorials make use of functions in some way:
|tutorial||description||example name in sdk|
|flash bulbs||this turns a bulb on then off each second. It makes use of the **context** object to store state between the receipt of new data||databox.tutorial-on-off|
|shake light||this takes the sensingkit accelerometer x data and turns a bulb on or off when it hits a threshold value||databox.tutorial-shake-light|
|binary count||this uses the **context** object and has multiple outputs||databox.tutorial-hue-binary|