Collection of useful agent codes: Please add

Hi,
Thought I start a collection of agent codes for beginners like myself so we could reference to and try out. Whlist the codes all documented elsewhere in the forum etc, it would very to have it all in one place. Please add to the list so we can all share…

Thanks,

Ken

I’ll start off with a few agent codes, all from the famous “inventor”

  1. Hello world
    https://gist.github.com/beardedinventor/6694483

  2. Toggle (TickTock): previous life as vimp ticktoc
    tickTock <- 0;
    function TickTock() {
    // do a thing
    // your code here…

    // flip tick tock
    tickTock = 1 - tickTock;
    function.wakeup(1.0, TickTock);
    }TickTock();

  3. HTTP In - Controlling an LED with web requests.
    http://electricimp.com/docs/gettingstarted/3-agents/

  4. HTTP Out - Basic example demonstrating a POST request.
    http://electricimp.com/docs/api/http/post/

  5. Cosm (which is know Xively - Class for sending data to Xively.
    https://github.com/electricimp/reference/tree/master/webservices/xively