Texas Instruments University Program
Published

Blinking LEDs with MSP430 and Energia

Learn how to blink multiple LEDs with MSP430 and Energia.

BeginnerProtip1 hour1,744
Blinking LEDs with MSP430 and Energia

Things used in this project

Hardware components

MSP-EXP430G2 MSP430 LaunchPad
Texas Instruments MSP-EXP430G2 MSP430 LaunchPad
×1
Solderless Breadboard Full Size
Solderless Breadboard Full Size
×1
5 mm LED: Green
5 mm LED: Green
Can do any color of LED - we chose green.
×7
SparkFun Resistor for LED any value under 1K Ohms
We chose 560 ohms, but any amount under 1K ohms will work
×7
Male/Female Jumper Wires
Male/Female Jumper Wires
The Jumper Wires you get will depend on your LaunchPad headers. Ours are M/F
×9

Software apps and online services

Energia
Texas Instruments Energia

Story

Read more

Schematics

blinking_led_schematic_lqgJWDFmSg.PNG

Code

Multiple_LEDs1_oneafterother.ino

Arduino
/*
  Blink- modified from example to blink seven LED's.
  Turns on an LED on for one second, then off for one second, repeatedly.
  Texas Instruments University Microcontrollers- Larissa Swanland
 */


//VARIABLE DECLARING- GLOBAL (these will run through the entire program)
//no variables at this time


void setup() {                
  // initialize the digital pin outputs.
  pinMode(3, OUTPUT);  
  pinMode(4, OUTPUT); 
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT); 
}

void loop() {
  digitalWrite(3, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(3, LOW);    // set the LED off
  delay(1000);              // wait for a second
                    //repeat for all of the other LED's 3-9
  
  digitalWrite(4,HIGH);
  delay(1000);
  digitalWrite(4,LOW);
  delay(1000);
  
  digitalWrite(5,HIGH);
  delay(1000);
  digitalWrite(5,LOW);
  delay(1000);
  
  digitalWrite(6,HIGH);
  delay(1000);
  digitalWrite(6,LOW);
  delay(1000);
  
  digitalWrite(7,HIGH);
  delay(1000);
  digitalWrite(7,LOW);
  delay(1000);
  
  
  digitalWrite(8,HIGH);
  delay(1000);
  digitalWrite(8,LOW);
  delay(1000);
  
  
  
  digitalWrite(9,HIGH);
  delay(1000);
  digitalWrite(9,LOW);
  delay(1000);
}

Credits

Texas Instruments University Program

Texas Instruments University Program

54 projects • 99 followers
TI helps students discover what's possible to engineer their future.

Comments