A Complete Guide through Building Your First Ever Project on CloudX CloudX
Perhaps, you are relatively new to the CloudX; this little exercise is to simply get you up to speed as regards effectively building your first ever project on the platform.
Here, a simple “Hello, World!” and LED project is created to demonstrate how CloudX package works. The project is organized in stages:
- (i) the section showing the steps involved in creating a .c file (source file) using the CloudX Programming Editor;
- (ii) the file Compiling section;
- (iii) and the generated hex file-loading into the CloudX Microcontroller.
.c File (source file) Creation
- Go to the directory where your CloudX Programming Editor is located on your computer. For our case study, it is located on the Desktop (the shortcut) for ease of access.
- Click it Open.
- Then, click on the File button and select New from the drop-down menu to open a new file.
- Alternatively, click on the button on the Standard Tools Bar to open a new project.
- It opens to the default workspace as shown below.
From the menu bar, click on the Add Library button to #include the library header files of interest to your project. In our case, the LCD and CloudX-M633 library header files are to be included.
AutoCorrect Hint made available by the CloudX Editor aids ease of typing; and minimizes possible syntax error(s).
- At the time the code writing is completed, click on the Save button on the menu bar to save your work in a desired folder.
(Alternatively, save process could automatically commence at the click of the Build button.)
- While saving a work in a desired folder, it is recommended that the location selected be a one that can easily be remembered. Thus, pick a parent folder where all your subsequent works could always be saved in a more organized manner; and easily traceable too.
With that comes the creation of your source file finally completed.
However, it is pertinent to note that a valid file-name here is the one without any white space(s) in-between.
Wrong way of file naming:
Compiling Your Code with CloudX IDE
- To initiate compiling the code, click on the Select Device on the menu bar to select the active MCU series in the project.
- Then, click on the Build button on the menu bar to compile the project/code.
- Now, it is noteworthy that the compiler, while processing the file into a machine code, checks to ensure that the raw code (ie. source file) itself is error free. Thus, as it is literally Cleaning and Building your project, it will either return a BUILD FAILED alongside some hint error messages, or a BUILD SUCCESSFUL.
- Moreover, if per adventure, the current project is not yet saved and the Build button is hit, the build process automatically engages the save routine.
- View below for a typical successfully compiled project.
The pictorial view below tries to simulate an error into the project and sees how it pans out.
Expectedly, it fails the Build process!
.hex File (Hex Compiled File) Loading into CloudX Microcontroller
- At this point, it is now left for the Hex file to be loaded into the microcontroller board so as to bring to life -at last, our hardware project. Here, the CloudX Code Loader comes into play.
- Click on it to initiate the process.
- Interestingly enough, the on-board Loader app automatically searches and thereby detects the Com Port to which the CloudX Microcontroller is connected (via the softcard). It flags up an error message, in case something goes wrong along the way. See the snippet below.
- Browse for the already created Hex file ─(following the previous stage of Compilation).
To conveniently do that, just navigate through your computer directory on that window to select your project folder; and then follow the below path in order to finally access the Hex file.
- Then, click the Upload button to finally burn the .hex file into the microcontroller.
The hex file burning into the CloudX hardware processes as depicted below.
And voila, your hardware circuit application comes on alive!