
function eval(code)
  Evaluate a string containing JavaScript code

property Array.length
  Return the length of the array

property String.length
  Return the number of characters in the string

method Integer.parseInt(string)
  Convert a string representing a number into a number

method Integer.valueOf(char)
  Given a string containing a single character, return the numeric value of it

method Double.doubleToIntBits(val)
  Convert the floating point value given into an integer representing the bits contained in it

property Math.E
  The value of E - 2.71828182846

property Math.PI
  The value of PI - 3.14159265359

method Math.abs(x)
  Return the absolute value of X (as a double)

method JSON.stringify(object)
  Convert the given object into a JSON string which can subsequently be parsed with JSON.parse or eval 

method JSON.parse(string)
  Parse the given JSON string into a JavaScript object 

method String.charAt(idx)
  Return a single character at the given position in the String.
  Negative values return characters from end of string (-1 = last char)
  Running on a non-string returns 0

method String.indexOf(substring)
  Return the index of substring in this string, or -1 if not found

method String.substring(start,end)

method String.substr(start,len)

method String.split(separator)
  Return an array made by splitting this string up by the separator. eg. "1,2,3".split(",")==[1,2,3]

method Object.clone()
  Copy this object in its Entirity

method Array.contains(value)
  Return true if this array contains the given value

method Array.indexOf(value)
  Return the index of the value in the array, or -1

method Array.join(separator)
  Join all elements of this array together into one string, using 'separator' between them. eg. [1,2,3].join(" ")=="1 2 3"

method Array.push(value)
  Push a new value onto the end of this array

method Array.pop()
  Pop a new value off of the end of this array

function print(text)
  Print the supplied string

function getTime()
  Return the current system time in Seconds (as a floating point number)

function setTimeout(function, timeout)
  Call the function specified ONCE after the timeout in milliseconds.
  The function may also take an argument, which is an object containing a field called 'time', which is the time in seconds at which the timer happened
  This can also be removed using clearTimeout

function setInterval(function, timeout)
  Call the function specified REPEATEDLY after the timeout in milliseconds.
  The function may also take an argument, which is an object containing a field called 'time', which is the time in seconds at which the timer happened
  This can also be removed using clearInterval

function clearTimeout(id)
  Clear the Timeout that was created with setTimeout, for example:
   var id = setTimeout(function () { print("foo"); }, 1000);
   clearTimeout(id);

function clearInterval(id)
  Clear the Interval that was created with setTimeout, for example:
   var id = setInterval(function () { print("foo"); }, 1000);
   clearInterval(id);

function digitalRead(pin)
  Get the digital value of the given pin.
  Pin can be an integer, or a string such as "A0","C13",etc. 
  If pin is an array of pins, eg. ["A2","A1","A0"] in which case an integer representing that value will be returned (first array element is the MSB).

function analogRead(pin)
  Get the analog value of the given pin as a value between 0 and 1.
  This is different to Arduino which only returns an integer between 0 and 1023
  Pin can be an integer, or a string such as "A0","C13",etc
  However only pins connected to an ADC will work (see the datasheet)

function digitalWrite(pin, value)
  Set the digital value of the given pin.
  Pin can be an integer, or a string such as "A0","C13",etc
  If pin is an array of pins, eg. ["A2","A1","A0"] in which case value will be treated as an integer where the first array element is the MSB

function analogWrite(pin, value)
  Set the analog value of the given pin. Value is between 0 and 1
  Analog values are output as PWM digital. If the pin is not capable a warning will be output
  Pin can be an integer, or a string such as "A0","C13",etc     

function digitalPulse(pin,value,time)
  Pulse the pin with the value for the given time in milliseconds
  eg. pulse("A0",1,500); pulses A0 high for 500ms
  Pin can be an integer, or a string such as "A0","C13",etc

function setWatch(function, pin, repeat)
  Call the function specified ONCE (if repeat==false or undefined) or
  REPEATEDLY if (repeat==true) when the pin changes
  The function may also take an argument, which is an object containing a field called 'time', which is the time in seconds at which the pin changed state
  This can also be removed using clearWatch

function clearWatch(id)
  Clear the Watch that was created with setWatch.

function load()
  Load program memory out of flash 

function save()
  Save program memory into flash 

function reset()
  Reset everything - clear program memory

function echo(yesorno)
  Should TinyJS echo what you type back to you? true = yes (Default), false = no.
  When echo is off, the result of executing a command is not returned.
  Instead, you must use 'print' to send output.

function trace()
  Output debugging information 

function dump()
  Output current interpreter state such that it can be copied to a new device 

function bitRead(value, bitnum)
  Get the specified bit from the value. Lowest significance bit is 0

function bitWrite(value, bitnum, bitdata) 
  Write the specified bit from the value. Lowest significance bit is 0

function bitSet(value, bitnum)
  Set the given bit in the value. Lowest significance bit is 0

function bitClear(value, bitnum)
  Clear the given bit in the value. Lowest significance bit is 0

function bit(bitnum)
  Get the value of the specified bit (0->1, 1->2, 2->4, 3->8 etc). Lowest significance bit is 0

function lowByte(value)
  Return the low byte of the value

function highByte(value)
  Return the high (second) byte of the value
