Simple code for an MSP430 microcontroller and device schematic.