here's a bare-bones sketch, developed with Energia 17
typedef volatile unsigned long reg_t;
reg_t * pHIBCTL = (reg_t *)0x400fc010UL; // hibernation control, see datasheet page 505
void setup()
{
// set the pin for the red LED as OUTPUT
pinMode(RED_LED, OUTPUT);
// enable internal pullup for the pins connected to the pushbuttons
pinMode(PF_0, INPUT_PULLUP); // SW2 and the /WAKE pin
pinMode(PF_4, INPUT_PULLUP); // SW1 is connected to this pin
} // end setup()
void loop()
{
// flash LED at 4Hz
digitalWrite(R