Lab 1: Space Invaders. The Introduction

Similar documents
Lab 1: Simon. The Introduction

Welcome to Lab! You do not need to keep the same partner from last lab. We will come around checking your prelabs after we introduce the lab

Welcome to Lab! Feel free to get started until we start talking! The lab document is located on the course website:

Lab 1 Implementing a Simon Says Game

Lab 1 Implementing a Simon Says Game

Welcome to Lab! Feel free to get started until we start talking! The lab document is located on the course website:

Lab 0 Introduction to the MSP430F5529 Launchpad-based Lab Board and Code Composer Studio

ECE2049 Embedded Computing in Engineering Design. Lab #0 Introduction to the MSP430F5529 Launchpad-based Lab Board and Code Composer Studio

ECE2049: Embedded Systems in Engineering Design Lab Exercise #3 C Term Making a Time and Temperature Display

ECE2049: Embedded Computing in Engineering Design A Term Fall Lecture #8: Making it work: LEDs, Buttons & Keypad

Code::Blocks Student Manual

Moving Materials from Blackboard to Moodle

CSCI 201 Lab 1 Environment Setup

ECGR 4101/5101, Fall 2016: Lab 1 First Embedded Systems Project Learning Objectives:

SECTION 2: HW3 Setup.

Note: This is a miniassignment and the grading is automated. If you do not submit it correctly, you will receive at most half credit.

DIRECTV Message Board

CS 051 Homework Laboratory #2

For Volunteers An Elvanto Guide

GOOGLE DRIVE & DOCS. USERNAME: [for example,

Quick Start Guide TWR-S08DC-PT60. Tower System Daughter Card for the 5-Volt 8-bit MC9S08P Family TOWER SYSTEM

Notifications 4 How to set notifications for a particular item 4. s 4 How to one or more members of the committee 4

These are notes for the third lecture; if statements and loops.

[ 8 marks ] Demonstration of Programming Concepts

Microsoft SharePoint 2010

YOUR GUIDE TO. Skype for Business

15-411/ Compiler Design

This presentation will show you how to create a page in a group eportfolio.

Web Report Library User Guide

Programming assignment A

Review Response Submission Form

CSC 101: Lab #8 Digital Video Lab due date: 5:00pm, day after lab session

What s New in Blackboard 9.1

Testing. Topics. Types of Testing. Types of Testing

CSE 374 Programming Concepts & Tools

EasySites Quickstart Guide. Table Of Contents

Lab 8: Debugging Embedded Devices and Software

Engr 123 Spring 2018 Notes on Visual Studio

Quick Start Guide TWR-S08PT60. 5-Volt S08P Family of 8-bit MCUs for Industrial and Appliance Applications TOWER SYSTEM

FX SERIES. Programmer s Guide. Embedded SDK. MN000540A01 Rev. A

HTML/CSS Lesson Plans

Getting Started with the elearning Portal. (Blackboard 9.1)

Access your page by hovering over your campus and then choosing Staff Directory. Click on your name to enter your page.

Putting Open Access-into Interlibrary LoanJoe Mcarthur

Lab 01 How to Survive & Introduction to Git. Web Programming DataLab, CS, NTHU

Lab 4: Imperative & Debugging 12:00 PM, Feb 14, 2018

Texas Instruments Mixed Signal Processor Tutorial Abstract

ECE2049: Embedded Computing in Engineering Design C Term Spring Lecture #7: More Digital IO

Code::Blocks Student Manual

Blackboard s My Content Area Using your Private Central File Repository

Welcome to today s Webcast. Thank you so much for joining us today!

Getting Up and Running

1.00 Lecture 2. What s an IDE?

By the end of Class. Outline. Homework 5. C8051F020 Block Diagram (pg 18) Pseudo-code for Lab 1-2 due as part of prelab

Check out FilesAndExceptions from SVN. Exam 2 Review File I/O, Exceptions Vector Graphics Project

JavaScript Fundamentals_

Homework , Fall 2013 Software process Due Wednesday, September Automated location data on public transit vehicles (35%)

CS354 gdb Tutorial Written by Chris Feilbach

Adding content to your Blackboard 9.1 class

Creating Pages with the CivicPlus System

EE 355 Lab 3 - Algorithms & Control Structures

SECTION 2: Loop Reasoning & HW3 Setup

ECE2049 Homework #2 The MSP430 Architecture & Basic Digital IO (DUE Friday 9/8/17 at 4 pm in class)

proj 3B intro to multi-page layout & interactive pdf

SECTION 2: Loop Reasoning & HW3 Setup

COMP Summer 2015 (A01) Jim (James) Young jimyoung.ca

Lab 4: Interrupts and Realtime

Insight 360 Curriculum Integration Deer Park High School South Campus

Getting Started with Eclipse/Java

Page design and working with frames

Module 3: Changes and Correspondence

Laboratory 1: Eclipse and Karel the Robot

Tips from the experts: How to waste a lot of time on this assignment

CS Problem Solving and Object-Oriented Programming

HyperDialer Tutorial By Phone Broadcast Club

To Update and Maintain Your Team Website

The Road to CCSv4. Status Update

Blackboard Basics. Please see handout for information on how to get to the CUNY Portal and log in to Blackboard.

The RBE Development board is designed to use an AVR644P to control a robotics system. The Board has multiple functions and features.

VERSION GROUPWISE WEBACCESS USER'S GUIDE

Familiarity with data types, data structures, as well as standard program design, development, and debugging techniques.

Slide 1. Slide 2. Slide 3. By: Kat Snizaski CCIT Trainer

Developing Android applications in Windows

CSC 443: Web Programming

CheckBook Pro 2 Help

HOW TO SUBMIT A SPECIAL TOPIC PRESENTATION OR TEST-FOCUSED WORKSHOP FOR THE 2014 NAN ANNUAL CONFERENCE Submission Deadline: April 1, 2014

[ Getting Started with Analyzer, Interactive Reports, and Dashboards ] ]

CS168 Programming Assignment 2: IP over UDP

Duplicate and customize an existing kahoot to fit your needs. Launch and host a kahoot game in your class

CS2112 Fall Assignment 4 Parsing and Fault Injection. Due: March 18, 2014 Overview draft due: March 14, 2014

Module 3: Working with C/C++

Get started with PING PONG

Using Virtual EEPROM and Flash API for Renesas MCUs RX600 Series

4 phases to understand owncloud

Laboratory Assignment #4 Debugging in Eclipse CDT 1

contribution-guide.org Release

Jumpstart Tutorial for Android

feel free to poke around and change things. It's hard to break anything in a Moodle course, and even if you do it's usually easy to fix it.

Com S 227 Assignment Submission HOWTO

HOW TO SUBMIT A TENDER/Quotation

Transcription:

Lab 1: Space Invaders The Introduction

Welcome to Lab! Feel free to get started until we start talking! The lab document is located on course website: https://users.wpi.edu/~sjarvis/ece2049_smj/ Be sure your lab board has the 4 LED jumpers (i.e. the 4 multicolored LEDs worked in Lab 0 Ask a member of the course staff if not We will come around checking your pre-labs after we introduce the lab. BOTH lab partners need to submit THEIR OWN Prelab If you didn't have a partner for Lab 0 you probably will want one for this lab Let us know if you have any questions!

Space Invaders Basic requirements: Aliens falling from screen Press numbered keys to kill them Multiple levels, increasing difficulty, etc. YOU HAVE ALL THE I/O FUNCTIONS YOU NEED IN THE DEMO PROJECT You simply need to write a new main() You can make this as complex as you want Have fun with it!

The Important Parts A data structure to store the aliens Arrays, 2D arrays, structs you decide! You may NOT hard-code the positions of the aliens with lots of if statements! (Why is this bad?) Support for making the aliens fall down the screen, while being able to press a button to kill them You can t use a software delay for this, why? It's better to enter a Polling Loop and check for key presses a certain number of times (like ~10000 times) Think about how you will do this during lab today ask us if you need help!

How to start a new lab You should start each lab with a fresh copy of the template demo project (Instructions follow) If you started with a blank workspace, import the template again using the menus: Project Menu > Importing Existing CCS Project Select Archive File and then select the template project

Starting a new project 1. Copy your project Right-click on the project 1. (Opens the Project Menu ) 2. Select Copy

Starting a new project (cont d.) 2. Paste! 1. Open the Project Menu again 2. Select Paste 3. Enter a new project name 4. Click OK. This will create a new project called lab 1 for you to use!

Clearing out the demo project You can clear out all of the code from lab 0, except the following code // Don t remove any #include statements void main(void) { WDCTL = WDTPW WDTHOLD; // Stop watchdog timer // Useful code starts here initleds(); configdisplay(); configkeypad(); // Your setup code goes here! // (Initialize variables, configure things, etc.) } while(1) { // Your code goes here! } Note: This is the bare minimum. You should refer back to Lab 0 for examples of how to use the display, LEDs, keypad, etc. (Read the comments!)

How to start Don t try to write the whole lab at once! Instead, build small parts and test them Focus on The Important Parts today (Which you started thinking about for your pre-lab, right?) How to make aliens fall from the screen and using the keys to kill them You may want to use a state machine for this How to represent the aliens Review your pre-lab with your partner and decide how to proceed Feel free to ask us questions, too!

Code Smarter, Not Harder A big part of this lab is learning how to use control flow effectively This means how you use if and switch-case statements, for and while loops, etc. Spend time thinking about HOW to structure your code This kitty is frustrated by poor control flow. Good control flow makes your code easy to debug. This will save you time!

Code Smarter, Not Harder If you find yourself using any of the following Lots of nested loops or if statements (> 3 is probably bad practice) Copy/pasting blocks of code and changing it slightly Code that gets stuck in certain places Lots of global variables that modify your program s state you should rethink your control flow: Feel free to ask us for help on HOW to approach a problem It is MUCH easier for everyone if you ask for help here, rather than trying to debug your code later!

Example state machine The program looks at the variable state on each iteration of the while loop Before leaving each state, we define the next state At the end of a state, the loop restarts and we enter the next state (This code waits until dothing() returns 0, without using a separate while loop!) Bonus Questions What happens if you miss a break statement? Why should state NOT be global?

When things don t work try to use the debugger to help you! How far does your program get when it stops working? Does it ever reach state X? Set a break-point at the start of a state Does it make certain decisions correctly? Set breakpoints at critical if statements, etc. Examine variables (watch/expressions windows) to see if information is what you expect Debugging is an important skill. Try to narrow down the problem on your own, but feel free to ask for help!

Saving your work All of your work is saved on your network drive Log into any lab machine to access your workspace and projects If you want to save a copy of your code, see the instructions to save as a zip file Good for making a backup copy or to send to your partner!

Saving your work Please do NOT use the following methods to save your work: Directly copying files (You will miss settings files) Pasting code into an email, Word, or Google doc (super gross) Snapchat (No.) A public Github repository (Other people will steal it!)

Submitting your code online When you submit your lab report, you will also submit your code on Canvas for grading See instructions in Lab document Do not forget this step, or you won t get graded! Only one submission per team is required Be SURE to follow ALL of the instructions or it makes grading difficult for us

Good luck and have fun! Feel free to ask us if you have questions we re here to help! These slides will be posted for you to view later See instructions for submitting your code when you are done with the lab! Be sure to look at the Frequently Asked Questions! Thank you for listening!

How to submit your code 1. RENAME your CCS project You MUST do this to submit your code online! You MUST do this from CCS! (Renaming just the project folder won t work!) 1. Open the Project Menu again You re not done renaming yet see the next slide! 2. Select Rename

Naming your project for submission To submit online, you project must have a name in this format: ece2049a17_lab1_username1_username2 Fill in the USERNAMES of you and your partner NOT your full name NOT your nickname Failure to do this properly may cause problems when grading!

Exporting your Lab These steps will create an archive (a zip file) of your whole CCS project This is useful for submitting your code or creating a backup copy of your project 1. Open the Project Menu 2. Select Export

Exporting your Lab 1. Select Archive File 2. Click Next

Exporting your Lab Your project and all its files should already be checked 2. Click Finish This creates the zip file, which you can upload to Canvas 1. Click Browse and find a location to save your file. Give the zip file THE SAME NAME as your project.

Frequently Asked Questions (1/?) Help! I lost a window in CCS! Reset all of your windows to defaults, go to : View > Reset Perspective I have the warning Function declared implicitly Make sure you aren t missing any #include statements (rand() is in stdlib.h) If the warning is for one of your own functions, you are missing a function prototype. Google function prototypes for help!

Frequently Asked Questions I have a vague error saying Errors exist in project or Errors encountered during linking Look in the Console for the full output during compilation. If you scroll up a few lines, you may see some more information about the error. See the next slide for more info

Frequently Asked Questions Why does this variable have a value of.? This is because CCS is trying to show it as an ASCII character, but it has a value that isn t a character. You can change the format like this: Right click on the variable here Pick a format to display it here

Frequently Asked Questions Using the graphics library See lab 0 for examples especially the comments You can draw lines and shapes See the Graphics Library User Guide on the course website for examples You can also draw bitmaps (pixel art) Some examples are on the local machine at: C:\ti\ccsv5\ccs_base\msp430\msp430ware_1_40_00_26\examples\grlib\MSP- EXP430F5529_Grlib_Example\images We use a black and which screen, so all images should use 1bit/pixel resolution This is an advanced topic. If you want to do it, you re on your own.