Recent changes
Order
tag order
RTOS
Help
mbed NXP LPC1768
Firmware
Homepage
From the mbed microcontroller Handbook.  

Creating a program

The mbed Compiler is an online application used to create your own programs for the mbed microcontroller. It translates program source code that you write in to a program binary that the Microcontroller can execute.

The following instructions demonstrate how to generate the Program Binary used in the Microcontroller Getting Started example.

Instructions

1. Open the mbed Compiler

Open the online compiler using the link in the site menu (top-right of the page). This will open the Compiler in a new tab or window, so you can move back and forth to continue to read these instructions.

2. Create a New Program

/media/uploads/mbedofficial/new-project.png

/media/uploads/mbedofficial/main2.png

/media/uploads/mbedofficial/compiler-output.png

To create a new program in your personal Program Workspace:

Your new program folder will be created under "My Programs".

3. View the default program source code

Click on the "main.cpp" file in your new program to open it in the file editor window. This is the main source code file in your program, and by default contains a simple program already. The code should look like:

The other item in the program folder is the "mbed" library - this provides all the useful functions to start up and control the mbed Microcontroller, such as the DigitalOut interface used in this example.

4. Compile and Download the Program

To compile the program, click the Compile button in the toolbar. This will compile all the program source code files within the program folder to create a binary program.

Where next

Troubleshooting

  • Some web browsers and download managers will automatically download files to a predefined location. To configure the download location so you can save it to the mbed Microcontroller, see Choose-where-to-save-files-FAQ
  • If you have problems using cut and paste functionality (Ctrl+C, Ctrl+V) in IE7, see Cut-and-paste-IE-FAQ

If you have any problems, or think this tutorial could be improved, please tell us in the Forum!




calendar Page history
Last modified 02 Feb 2012, by   user Emilio Monti   tag No tags | 8 comments  

8 comments on Creating a program:

05 Oct 2010

Where next Back to handbook link is broken. Points to http://handbook

08 Oct 2010

Just created new project with multiple LEDs flashing. It took only two minutes from creating project to running the program!!!!! Wow! Wow !!..Amazing!!

20 Oct 2010

I have also problems with Ctrl-C and Ctrl-V, some times is puffer emty after one paste, some time not. So I think problem with Compilerside. Also please insert search and replace, can be very helpful.

02 Nov 2010

Lovely, I can see I'm going to spend far too much time here enjoying myself.

06 Nov 2010

Received the mbed module this morning, tried this afternoon, it took me 5 minutes to have the 4 Leds flashing as desired... Very amazing way to test... I'm now searching documentation on compiler syntax to go further

21 Nov 2010

The cookbook is a fantastic place to increase my knowledge about hardware. After 20 minutes I have two serial servos compiled and running. But here are the same copy-paste glitches in the compiler... Is it possible to implement a "goto line" and a "search" function? This would make my mbed life much easier. Thanks & greets!

13 Jan 2011

just fyi: the line "Mac users, Command-Click", should read "Mac users, Control-Click"

26 Mar 2011

For some Linux (and possibly BSD) users, when you download the program, sometimes when you restart the mbed it won't do anything. It'll act like you never put the program on the usb device. The fix for this is to run the `sync` command. This forces the OS to flush it's cache and write everything in memory(ie, your program) to disk(ie, the mbed). Other than that, this thing is awesome! :)

Please login to post comments.