Home ← TI-Nspire Scripting HQ ←STEM HQ ← Getting Started with TI LaunchPads ← TI LaunchPad Lesson 1
Lesson 1: My first LaunchPad sketch - Blink an LED
Lesson 1: My first LaunchPad sketch - Blink an LED
Lesson 7 - Real world data at your fingertips: Light, Ultrasonic Motion and more...
Lesson 8 - Build your own BLE ultrasonic motion detector for under $USD30
Connecting Computer and LaunchPad
So, you have your LaunchPad (or your TI Innovator™ Hub), and you have downloaded and installed Energia and the required drivers for your system. Open Energia and connect the LaunchPad via USB to your computer (I will be showing screenshots from my MacBook, but the main features should be readily transferable across platforms.)
Go to the Tools menu and check under "Board" and "Serial Port". You should see something similar to the following:
You will need to ensure that you select the correct board (there is only one MSP432 but there are several MSP430 varieties, so make sure that you have the right one!). Then check that your serial port is active - if not, try unplugging and replugging the board, or quitting and restarting the software. Occasionally, I have needed to reboot my computer with the device plugged in. Normally, though, it should work automatically - there is good trouble-shooting support at the Energia site.
Hacking the Hub™
|
|
My First Sketch
|
|
Compile Your Sketch (check for errors) It all looks OK, so first we check our code by 'compiling' it. Click on the check mark in the red circle at the top left of the window and watch the bottom of the window - lots of text flows past as it verbosely reports everything that is happening, and then (hopefully) it will report 'Done compiling'. If not, then go back and check that there is a semi-colon where required, or have a look at the error message in the report. Upload Your Sketch (send to the board) If all is correct, then you can proceed to 'upload' the sketch to the board using the 'upload' button (round red right-pointing arrow next to the Compile button at the top left of the window.) Uploading may take a little while, even for a short sketch like this (mine takes around 30 seconds). Once you finish and get the "Success" message, you should see the red LED flashing on and off on your board. Congratulations! You have run your first sketch! |
|
Some Challenges
Now go back and change some of the values to see what happens. The MSP432 has RED_LED, GREEN_LED and BLUE_LED (the MSP430 has only RED and GREEN, and the CC3200 has red, green and yellow!). Try each of these and try different delay settings.
MSP430: Try having it flash red, then green!
MSP432: Try having it flash red, then green, then blue!
|
|
|
|
Now go back and try a few more examples from the examples menu! Much fun awaits!
Home ← TI-Nspire Scripting HQ ←STEM HQ ← Getting Started with TI LaunchPads ← TI LaunchPad Lesson 1