Home TI launchpad MSP430G2 LaunchPad LED example

MSP430G2 LaunchPad LED example

This is a basic ‘hello world’ example for the MSP430G2 LaunchPad, this example uses the Energia development environment. For people who have used the Arduino development environment you will recognize the user interface instantly.

Here are some details of the micro at the heart of the launchpad

  • 16MHz
  • 16KB Flash
  • 512B RAM
  • 8channel 10-bit ADC
  • Comparator
  • 2 16-bit Timers
  • Up to 1 I2C, 2 SPI, 1 UART

This is a first example I’ll be bringing more examples using this board fairly soon

In the schematic below you can see I’ve simply connected an LED to P1.7

msp430g2 and led example

msp430g2 and led example

Code

This code was written in Energia available from http://energia.nu/

[codesyntax lang=”cpp”]

// the setup routine runs once when you press reset:
void setup() 
{                
  // initialize the digital pin as an output.
  pinMode(P1_7, OUTPUT);     
}

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

[/codesyntax]

 

Links

 

T1 MSP-EXP430G2 LaunchPad Value Line Development Board Texas Instruments msp-exp430g2 launchpad

msp430 development board msp-exp430g2 launchpad

You may also like