2012 SJ One Hello World Sample Project

From Embedded Systems Learning Academy
Revision as of 23:03, 4 September 2013 by Preet (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Introduction

This article will teach you:

  • Write a simple program for the SJ One Board
  • Output data from the Board Sensors

Please note that you need to read the Development Package article before following along this article.

The MAIN Function

The main() function is the entry point of a program. A lot of things may happen before main(), but it would be usually abstracted away from the user.

Locate main.cpp in your project

Hello World

Your "Hello World" project consists of printf message, compiling, loading the program onto the board, and confirming that your message comes out as you intended it. Follow these steps:

  1. Open up Eclipse
  2. Open Hello World Sample Project
  3. Open up main.cpp (You could search for it using shortcut key Ctrl+Shift+R)
  4. Write your own printf outputting your favorite message: printf("My own hello world!");
  5. Compile & Load the program onto the Board
  6. Open COM Port in Hercules and press RESET on the board to view your printf message.