Project Proposal Design Details Protocol Source Code Future Features

About

Protocol

The protocol for programming the Christmas light controller is called Light Interfacing, Santa Helping Protocol (LISHP).  There are two types of commands used in LISHP: the mode command, used to make the basic building blocks; and the program command, used to make large complex sequences using the modes. The LISHP protocol ignores all white space.

Mode command

The complete grammar is as follows:

Examples:

M 0
{
    #alternates the first and last 8 light controls
    (1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0)
    (0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1)
}

M 1
{
    #Rainbow up
    (1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
    (0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
    (0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0)
    (0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0)
    (0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0)
    (0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0)
    (0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0)
    (0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0)
    (0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0)
    (0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0)
    (0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0)
    (0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0)
    (0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0)
    (0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0)
    (0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0)
    (0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1)
}

Program command

The complete grammar is as follows:

Examples:

P
{
    #this program will run mode 0 for 10 seconds and then repeat mode 1 forever
   (100 2 0)
    L 0
    {
        (32 2 1)
    }
}

P
{
    #this program will play mode 0 then mode 1 and repeating 5 times before stopping
    L 5
    {
        (30 2 0)
        (32 2 1)
    }
}