Grove Examples > Blink

Grove Getting Started

Test your LaunchPad by running the Blink Example. File > Examples > Basic > Blink

Example Video

Hardware Required

  • TI LaunchPad

 

Schematic

None. This basic example just uses your LaunchPad only.

Code

/*
  Blink
  The basic Energia example.
.
  Change the LED define to blink other LEDs.
  
  This example code is in the public domain.
*/
// most launchpads have a red LED
#define LED RED_LED

//see pins_energia.h for more LED definitions
//#define LED GREEN_LED
  
// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(LED, OUTPUT);     
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(LED, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(LED, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}

Grove Starter Kit Home