|
The C2C program is installed onto your windows start menu as 'C2C compiler' in the 'Matrix Electronics Series' program group. Start the program and you should see a screen which looks like: Fig 1.
This is the main compiler screen. In this environment you will create, modify, compile and download your C programs. Start the compiler and we will make a program together... We start editing by clicking on the (new) button.
The screen will change to: Fig 2. |
Fig 1. |
|||
|
If you have used a word processor you will be right at home here. Each of the programs is an individual document which you can work on, save and load just like you would with any other Windows program. Note that at the start the program has the name "untitled.c". The first thing you should do when you open a file is save it and give it a name. You can do this by selected the "Save As" command from the file menu: Fig 3. This will bring up the save file dialogue: Fig 4.
Give the name of the file in the file name box and press the save button. Note that you may not have the same file contents in your dialogue box as I did above! NOTE: The compiler prefers it if you put the ".C" extension after the filename. This way the files will show up correctly next time you try to open them.
|
||||
|
Fig 3. Fig 4. |
||||
|
I decided to give the file the name "first.c", which I then entered my program into: Fig 5.
Don't worry about what this program does at the moment (it is intended to light one of the LEDs and is explained in detail in our first exercise). Concentrate on copying the program correctly, with all the right kinds of brackets. I've created a directory on drive C: which I have called "C Programs". I would advise you to do the same. We can then save the file into this directory by clicking on the (save) button.
|
|
|||
|
Note that I have selected source code highlighting. This makes it easier to identify the various types of information my program contains. You can turn this on by selected the colors item from the Options menu. If you clear the "No Syntax Coloring" tick box you will see your source displayed as above. Fig 6. We will discuss the meanings of each of the different colours as we go through the course. Once you have entered the program source you are ready to compile and assemble it.
|
Fig 6. |
|||