This C program will make the Propeller microcontroller send a "Hello!!!" message to the SimpleIDE Terminal on your computer.
When SimpleIDE opens the project, it will open Hello Message.c into its text editor pane.
A single "Hello!!!" message should appear in the Simple IDE Terminal.
The print("Hello!!!") makes the Propeller chip send its message to your computer through its programming port. The SimpleIDE terminal displays the message on your computer screen.
The print("Hello!!!") is followed by a semicolon ;. The semicolon is what tells the PropGCC compiler that it has reached the end of an instruction statement.
The print statement is inside curly braces {} below main(), and so we call it part of the main function’s code block. A C program always starts with the first statement in the main function.
Print is also a function, but it is stored in other files called library files. Later on, you’ll get to search for libraries that contain useful functions to add to your own projects. For now, just keep in mind that your program needs #include "simpletools.h" because it has information about print, and many other useful functions.
The program has one statement: print("Hello!!!");. Let’s save this project under a new name, and add a second print statement.
Saving Programs
SimpleIDE saves your program each time it compiles. As you progress through these tutorials you will notice that we ask you to save a new copy of any program you'll be modifying to prevent you from overwriting the original project with one you have changed.
C is case-sensitive — You have to use the correct capitalization when programming in C. If you make an error, such as typing Print for example, SimpleIDE will let you know:
newline — \n is called the newline character, and it is an example of a control character used for positioning a cursor in a serial terminal.
int (main) — the int in int main() is part of the C compiler's programming convention. It is used no matter what you include inside the main function's code block. You will learn more about how int is used in other ways as you go through the tutorials.
Comments are notes about your code that help explain it to other people that have to work with it. Also, it is good to leave comments as notes to yourself about what you were doing in case you need a reminder days (or months or years) later.
If you want to comment all or part of a single line, use two forward slashes //. Everything to the right of // will be ignored by the C compiler. Block comments can span multiple lines. They start with /* and end with */, and everything in between will be ignored by the C compiler.