|
|||||||||||
Technical Support On-Line Manuals µVision3 User's Guide µVision3 Overview User Interface Creating Applications Create Project Selecting the Toolset Create Project File and Select CPU Project Workspace — Books Create New Source Files Add Source Files to Project Create File Groups Setting Tool Options Configure Startup Code Build Project Create HEX File Project Targets and File Groups View File and Group Attributes Overview of Configuration Dialogs Tips and Tricks Start External Tools after Build Process Folders for Listing and Object Files Custom and New Devices Create a Library File File and Group Specific Options File Extensions Importing µVision 1 Projects Version and Serial Number Information Including Library Modules Use a Custom Translator Different Compiler and Assembler Settings Utilities Debugging Debug Commands Debug Functions Simulation Flash Programming Dialogs Example Programs Command Line Appendix |
Create New Source FilesYou may create a new source file with the menu option File — New. This opens an empty editor window where you can enter your source code. µVision3 enables the C color syntax highlighting when you save your file with the dialog File — Save As... under a filename with the extension *.C. We are saving our example file under the name MAIN.C. #include <LPC210x.H> /* LPC210x definitions */ void wait (void) { /* wait function */ ; /* only to delay for LED flashes */ } int main (void) { unsigned int i; /* Delay var */ unsigned int j; /* LED var */ IODIR = 0xFF; /* P0.0..7 defined as Outputs */ while (1) { /* Loop forever */ for (j = 0x01; j < 0x80; j <<= 1) { /* Blink LED 0, 1, 2, 3, 4, 5, 6 */ IOSET = j; /* Turn on LED */ for (i = 0; i < 10000; i++) { /* Delay for 10000 Counts */ wait (); /* call wait function */ } IOCLR = j; /* Turn off LED */ } for (j = 0x80; j > 0x01; j >>=1) { /* Blink LED 7, 6, 5, 4, 3, 2, 1 */ IOSET = j; /* Turn on LED */ for (i = 0; i < 10000; i++) { /* Delay for 10000 Counts */ wait (); /* call wait function */ } IOCLR = j; /* Turn off LED */ } } } | ||||||||||
|
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.