Step-by-step instructions for setting up the Energia IDE and running your first Sketch on a Texas Instruments LaunchPad board.


  • Boards: Use the board manager to install support for additional cores.

  • Environment: Description of the Energia development environment.

  • Preferences: The Energia preferences file contains many options for customizing the way Energia compiles and upload sketches.

  • Build Process: Find out what steps your sketch goes through on its way to the LaunchPad board.

  • Pin Mapping: Complete list of all Pin Mapping images and instructions for each Energia supported hardware board.

  • Libraries: Complete list of all add-on libraries supported by Energia. Check out this tutorial for Energia 18!

  • Build IDE from Source: Use the latest code base from Github to create a build of Energia.

  • Import to Code Composer Studio: Use Energia functions and sketches in CCS version 6+, TI’s Eclipse-based IDE.

  • Import to CCS Cloud: Use Energia functions and sketches in CCS Cloud, TI’s browser-based IDE.


This section contains explanations of some of the elements of electronics, the LaunchPad hardware, the Energia software, and the concepts behind them.


  • Sketch: The various components of a sketch (Energia program) and how they work.

  • Electricity: The principle that powers electronics.

  • Circuits: The fundamental concept to electrical design.

  • Voltage: Electrical charge transported between two points.

  • Current: The flow of electrons in a wire.


  • Digital Pins: How the pins work and what it means for them to be configured as inputs or outputs.

  • Analog Input Pins: Details about the analog-to-digital conversion and other uses of the pins.

  • PWM: How the analogWrite() function simulates an analog output using pulse-width modulation.

  • Memory: The various types of memory available on the LaunchPad board.

  • Timers: Digital counters that increment or decrement at a fixed frequency used to sync electronic systems.

  • Registers: A placeholder for information about some hardware condition.

  • Sensors: Sensors are used to detect and measure analog signals from the environment.

Programming Technique

Basic Electronics Components

  • Breadboard: A prototyping surface to create solderless circuits.

  • Wires: Connect electrical components and systems.

  • Resistors: Alter your circuit voltage and current.

  • Capacitors: Store energy in a circuit.

  • Filters: Remove or enhance frequency components from the signal.

  • Amplifiers: Increase the power of a signal.

  • Transistors: Amplify and switch electronic signals.

  • Inductors: Resist changes in electric current.

  • Switches: Change the path of the electric flow.

  • Push Button: Inject a signal into a circuit.

  • Diode: Allows electric flow in only one direction.

  • LEDs: Light emitting diodes act as visual indicators.

  • Meters, Scopes, and Analyzers: Use these tools to measure voltage and current.

  • Integrated Circuits: Components that can do complex operations.


Core Functions

Simple programs that demonstrate basic Energia commands. These are included with the Energia environment; to open them, click the Open button on the toolbar and look in the examples folder. For some examples, additional hardware is required. These can be acquired individually or in popular electronics starter kits.

  1. Basics

    • BareMinimum: The bare minimum of code needed to start an Energia sketch.

    • Blink: Turn an LED on and off.

    • DigitalReadSerial: Read a switch, print the state out to the Energia Serial Monitor.

    • AnalogReadSerial: Read a potentiometer, print it’s state out to the Energia Serial Monitor.

    • Fade: Demonstrates the use of analog output to fade an LED.

    • ReadAnalogVoltage: Reads an analog input and prints the voltage to the serial monitor.

  2. Digital

    • Blink Without Delay: Blinking an LED without using the delay() function.

    • Button: Use a pushbutton to control an LED.

    • Debounce: Read a pushbutton, filtering noise.

    • Button State Change: Counting the number of button pushes.

    • Input Pullup Serial: Demonstrates the use of INPUT_PULLUP with pinMode().

    • Tone: Play a melody with a Piezo speaker.

    • Pitch follower: Play a pitch on a piezo speaker depending on an analog input.

    • Simple Keyboard: A three-key musical keyboard using force sensors and a piezo speaker.

    • Tone4: Play tones on multiple speakers sequentially using the tone() command.

  3. Analog

    • AnalogInOutSerial: Read an analog input pin, map the result, and then use that data to dim or brighten an LED.

    • Analog Input: Use a potentiometer to control the blinking of an LED.

    • AnalogWrite: Fade 7 LEDs on and off, one by one, using an MSP430G2 LaunchPad board.

    • Calibration: Define a maximum and minimum for expected analog sensor values.

    • Fading: Use an analog output (PWM pin) to fade an LED.

    • Smoothing: Smooth multiple readings of an analog input.

  4. Communication

    • ReadASCIIString: Parse a comma-separated string of ints to fade an LED.

    • ASCII Table: Demonstrates Energia’s advanced serial output functions.

    • Dimmer: Move the mouse to change the brightness of an LED.

    • Graph: Send data to the computer and graph it in Processing.

    • Physical Pixel: Turn a LED on and off by sending data to your LaunchPad from Processing.

    • Virtual Color Mixer: Send multiple variables from LaunchPad to your computer and read them in Processing.

    • Serial Call Response: Send multiple vairables using a call-and-response (handshaking) method.

    • Serial Call Response ASCII: Send multiple variables using a call-and-response (handshaking) method, and ASCII-encode the values before sending.

    • SerialEvent: Demonstrates the use of SerialEvent().

    • Serial input (Switch (case) Statement): How to take different actions based on characters received by the serial port.

  5. Control Structures

    • If Statement (Conditional): How to use an if statement to change output conditions based on changing input conditions.

    • For Loop: Controlling multiple LEDs with a for loop.

    • Array: A variation on the For Loop example that demonstrates how to use an array.

    • While Loop: How to use a while loop to calibrate a sensor while a button is being read.

    • Switch Case: How to choose between a discrete number of values. Equivalent to multiple If statements. This example shows how to divide a sensor’s range into a set of four bands and to take four different actions depending on which band the result is in.

    • Switch Case 2: A second switch-case example, showing how to take different actions based in characters received in the serial port.

  6. Strings

  7. Sensors, Motors, & Displays

    • Temperature: use on board MCU core temp sensor.

    • Tilt Sensor: use a basic tilt sensor.

    • Servo: move a servo to control mechanical objects.

    • Basic Motor: turn a basic motor.

    • 7 Segment Display: display basic number and letter values.

    • 2x16 Character Display: output strings to a character display.

  8. MultiTasking

    • ButtonEvent: Read a button in one task and have another task wait for the button to be pressed.

    • EventLibrary: Send an event in one task and have another task wait for the event.

    • Monitor: Displays CPU utilization, task memory usage, etc. Requires VT100 terminal.

    • MultiAnalogInput: Reads analog inputs in differents tasks at different rates.

    • MultiBlink: Blink 3 LEDs at different rates.

    • MultiTaskSerial: Shows 2 threads sending a string to the Serial monitor at different rates.

  9. Connectivity

    • WiFi: WiFi library examples.

    • MQTT: Use the MQTT lightweight protocol to enable IoT & M2M applications.

    • StandardFirmata: Use firmata protocol to dynamically communicate with the microcontroller.

    • Temboo: Access hundreds of web APIs through Temboo using Energia.

    • AT&T M2X: Post Energia data to AT&T M2X cloud service.

    • BLE Mini: Use Red Bear Lab BLE Mini to control you LaunchPad.

    • Create a cloud dashboard with your Energia data using

    • Contiki: Access Contiki OS for IoT using Energia.

  10. BoosterPacks

    • EducationalBP MKII: examples involving buzzer, LCD, LEDs, accelerometer, push buttons, and more

    • CC3100: introduction to SimpleLink WiFi CC3100 BoosterPack

  11. Other Tutorials

    • Sidekick for TI LaunchPad: Use the Seeedstudio Sidekick Basic Kit for TI LaunchPad with Energia.

    • SIK for LaunchPad: Use the Sparkfun Inventor’s Kit with Energia.

    • Grove Starter Kit for LaunchPad: Use Grove modules to access sensors and components for prototyping.

    • O-Scope Operation: Learning how to use an Tektronix Oscilloscope with MSP430 LaunchPad.

    • LabVIEW Home: Use Energia in National Instruments LabVIEW.

    • Processing: Create GUIs and visual representations of Energia data using Processing IDE.

    • Full workshops on Energia material.

    • IoP Machine: Learn how to create an internet connected popcorn machine.

    • Energy Trace: Learn how to measure energy consumption in your Energia system.