J.W. BRUCE / TTU_CSC1300

Dependents:   CSC1300_EduBaseV2_Lab0 mbed_blinky EduBaseV2_Lab0 mbed_blinky ... more

Lab 0 Hello EduBase

Lab 0: Hello, EduBase!

Objective

In this lab, you will test out your EduBase-V2 board by printing "Hello, World!" on the LCD display module. This lab will help you become familiar with writing, committing, and publishing your own program on Mbed. You do not need to worry about how the LCD display module works or how to program it just yet; you will learn that in a later lab.

Before You Begin...

If you have not already done so, please read the following pages on how to set up your EduBase-V2 and Nucleo F031K6 boards, how to create your own Mbed account, and how to use the Mbed IDE. Make sure that you have already set up your EduBase board and created your Mbed account before starting on Lab 0.

Setting Up the EduBase-V2

Creating an Mbed Account

Navigating the Mbed IDE

Creating a New Program and Importing a Library

Saving, Committing, and Publishing a Program

Compiling and Uploading a Program

Template Code

Your Lab

If you get lost on any of the steps below, please refer to the above pages for help.

1. After setting up your EduBase-V2, Nucleo F031K6, and adapter boards and registering and confirming your account on Mbed, go to the Mbed IDE at https://ide.mbed.com. See Setting Up the EduBase-V2 and Creating an Mbed Account if you have not set up your EduBase-V2 or your Mbed account.

2. Create a new program called CSC1300_EduBaseV2_Lab0 following the instructions outlined in Creating a New Program and Importing a Library. Import the TTU_CSC1300 library into your new program. Pull up main.cpp.

Warning!

Do not make any edits or revisions to the TTU_CSC1300.cpp and TTU_CSC1300.h files in the TTU_CSC1300 library. The TTU_CSC1300 library was custom built so that the Nucleo F031K6 could be used with the EduBase-V2. These files contain a lot of the "behind the scenes" code so that you can run your program in main.cpp. You will have to import the TTU_CSC1300 library for every one of your labs.

3. Copy and paste the template code from the Template Code page into your main.cpp.

4. Fill out the comment box at the top of your main.cpp file with the important information about your program. It is imperative to include all of your group members' names if you are working in a group. Provided below is an example of how you should fill out your comment box. (Remember, comments are an essential part of programming. Do not forget to include comments.)

Filled_Out_Comment_Box

/*
 *     Lab #: 0
 * Lab Title: Hello, EduBase!
 * Author(s): Barry Allen, Kara Danvers, Oliver Queen
 *      Date: 8-24-2020
 *   Purpose: Prints "Hello, World!" on LCD display module
 */

5. Copy and paste the following line of code under the line with the comment that says, "FUNCTION PROTOTYPES GO HERE."

Goes_Under_FUNCTION_PROTOTYPES_GO_HERE

TextLCD lcd(TextLCD::LCD_CURSOR_ON_BLINKING_ON);

6. Copy and paste the following block of code under the line with the comment that says, "WRITE SOLUTION HERE," in the inner pair of brackets.

Goes_Under_WRITE_SOLUTION_HERE_in_inner_pair_of_brackets

        //blinks "Hello, World!" every other second
        lcd.printf("Hello, World!");
        wait_ms(1000);
        lcd.cls();
        wait_ms(1000);

7. Save your program and then commit it. When the Revision Commit box pops up, write a commit message that briefly explains what you have just done.

8. Compile your program and upload it to your Nucleo F031K6 board on your EduBase to see if it works. If you can read "Hello, World!" as it blinks every other second on your LCD display, you are ready to publish your program. Follow the steps at Compiling and Uploading a Program if you are still unsure how to do so.

9. Go to the Revision tab and publish your program. Keep the repository's name the same as your program (CSC1300_EduBaseV2_Lab0). In the description, briefly describe what the program does and include your group members' names. Make sure you publish your work as a program with Public (Unlisted) as its visibility. If you need some help, refer to Saving, Committing, and Publishing a Program. (This is the format you will follow when submitting the rest of your EduBase labs this semester.)

10. You will be given a link to your published repository. Submit the link to your new program by copying and pasting it into the comment box of the submission page for your entire lab assignment in iLearn. Make sure you also attach the ZIP file with your solution from the first half of the lab in the same submission.

Once you are done, you have officially completed your first lab on the EduBase! Next week, you will learn about the basics of digital input/output (I/O) using LEDs and pushbutton switches.


All wikipages