mtec2280

zeven edited this page May 4, 2016 · 107 revisions

Syllabus

mtec2280 Syllabus

#HW Upload

#Week 1

Class 1

Class 1 Slideshow

Class 2

####Using Wikis

Markdown Cheatsheet

####What is a feature?

Distinct property or piece

####What is an input?

What is put in, taken in, or operated on by any process or system.

####What is an output?

After information has been processed by a system and sent out. Outputs normally are manifested by a Example Trackpad

####Examples

#####Example Trackpad

Input - Dragging your finger over trackpad

Outputs - Moves mouse cursor

Feature - Cursor changes based on program

#####Example Citytech Turnstyle

Input - Waving Citytech ID Card over RFID Reader

Output - Bars unlock or open

Feature - Auditory acknowledgement

####I/O Worksheet

Week 1 Homework

  • Create Class repository
  • Create Class Wiki
  • Create Week 1 Assignment page
    • Add image to repository and link it to your wiki
  • Choose an 5 objects and list an input, output, and feature I/O Worksheet
    • Please post on your wiki

#Week 2

Class 3 - February 8

####Basic Unix Commands

cd - Change directory (e.g. cd pictures brings you to the sub-directory “pictures”)

cd .. - Change directory up one level to the parent directory

ls - Lists a directory of your files

ls -a - Lists a directory including the hidden files

pwd - See the current directory and path

mkdir - Creates a new directory (e.g. mkdir pictures creates a directory called “pictures”)

Basic Unix Commands

Command Line Exercise

Learning Python

Python Basics

More python tutorials

Python Examples

Creating Variables

var = 1

var1 = "hello"

Booleans

var3 = True

Printing

print(var) = 1

Math

addition = 72 + 23

subtraction = 108 - 204

multiplication = 108 * 0.5

division = 108 / 9

mod = 3%2

Class 4 - February 10

More info about Variables

>>> 'a' in message

True

>>> 'x' in message

False

>>> 'foo' in 'food'

True

>>> 'foo' in 'horatio'

False

####Making Decisions

Understanding whitespace in python:

Blocks of code are broken up by whitespace. In most languages blocks of code are broken up by curly braces.

True/false

Less than <

Greater than >

Less than or equal <=

Greater than or equal >=

Equals ==

Not equal !=

###Basic if else statements

var = 1
var2 = 2

if var > var2:
  print("var is bigger")
else:
  print("var is smaller")  

###Basic if elif else statements

var = 1
var2 = 2

if(var > var2):
  print("var is bigger")
elif(var2 < var)  
  print("var 2 is smaller")
else:
  print("No match")  

####Input from terminal

#####Creating a calculator app

Understanding program flow.

What makes up a basic calculator?

  • 2 numbers
  • Sign

Basic calculator

#####What is sys.argv?

sys.argv is a function that breaks apart the arguments into an array.

python calculator.py 1 + 2

         0        1 2 3

To access the array of terminal arguments:

sys.argv[0] => guess.py

sys.argv[1] => 1

####Class Examples

Guessing game

Class Notes

Week 2 - Homework

Make a guessing game

#Week 3

Class 5 - February 15 – No Classes

Class 6 - February 17

Review Calculator Example

####Lists

This module defines an object type which can compactly represent an array of basic values: characters, integers, floating point numbers.

xList = []

yList = [1,"hello", 'a', 1.234, 1]

dir(yList) # Gives you all the methods of an object

['__add__', '__class__', '__contains__', '__delattr__', '__delitem__', '__dir__', '__doc__', '__eq__', '__format__', '__
ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__iter__', '__le__'
, '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__', '__rmu
l__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', 'append', 'clear', 'copy', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort']

List Methods:

'append', 'clear', 'copy', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort'

####What is a function?

*Create blocks of code that, when called, perform tasks.

*Can return a response

*A combination of functions can be collected in a library

*We write functions because we can reuse

*Scope *Variables and instructions inside of functions are only available inside of the block

####What is a object?

Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which are data structures that contain data, in the form of fields, often known as attributes; and code, in the form of procedures, often known as methods self.

In python everything is an object. Objects contain characteristics and actions that make them unique, but are shared between objects.

#####Example

Human Object

Humans share several characteristics

*Eyes *Arms *Legs *Fingers *Mouth *Etc

Objects have methods or functions that animate, modify, and changes itself. Methods for our human object can include:

*Human.move()

*Human.blink()

*Human.wiggleToes()

Week 3 Homework

Option 1: Finish simple calculator. Add if statements to calculate subtraction, multiplication, division. Use ' * ' and '/' in for multiplication and division. ie. python calculator.py 1 '*' 1

Option 2: Create a simple trivia game. It should have 3 questions

#Week 4

Class 7 - February 22

####Loops

Calculator Addition and Multiplication

Looping through numbers and array elements

While Loop

input prompt

Infinte Loop with Exit

Guessing Game with Loop and Exit

Class 8 - February 24

####Working with Strings

>>> message = "python"

>>> message

'python'

>>> message + " is for lovers"

'python is for lovers'

>>> message = "bungalow"

>>> message[3]

'g'
>>> message[1:6]

'ungal'

>>> message[:3]

'bun'

>>> message[2:]

'ngalow'

>>> message[-2]

'o'

>>> message[:]

'bungalow'

len(message) - can be used to find a length of a string or list

Chooses Random Pairs of Teams

String List Search

####Text Adventure Slides

Week 4 Homework

Design a game: Create a text adventure or interactive game. Write a story about and illustrating how your game is played. Your game should have 5 stages. You should create a path to finish your game.

#Week 5

Class 9 - February 29

#####functions

Basic Function

Simple Trivia with Function

Simple Trivia with Return Function

Simple Trivia with Multiple Return Function

State Machine

Class 10 - March 2

Open Lab - start working on game projects

Week 5 Homework

With your partner start designing your game. Think of challenges, puzzles, and obstacles. For homework, use a state machine to navigate through your world.

Groups

Sean James

Woodrow Ziaul

Davina Tamanda Robin

Shane Kenny

Armin Miles

Charlie Jennifer

Ryan Saranjit

#Week 6

Class 11- March 7

Keeping Score and Life bar Example

Class 12 - March 9

Modifying Game Engine

Making an object

Week 6 Homework

Have Arduino kits by next week.

Finish all outstanding assignments.

#Week 7

Class 13 - March 14

####Intro Arduino

Arduino

Arduino Reference

Electricity and Components

Class 14 - March 16

Sensors

Breadboard

Breadboard Simple Setup

Series

Parallel

Breadboard LED

Basic Arduino LED

####Week 7 Homework

Finish Games

#Week 8

Class 15 - March 21

Python Project Due

####Week 8 Homework

Upload Story, Code, Current Issues, and Future Expansion/Goals

Class 16 - March 23 – Friday Schedule

#Week 9

Class 17 - March 28

Basic Breadboard

Simple LED

Breadboard

Class 18 - March 30

####Week 9 - Homework

Write a program that uses 3 LEDs. Come up with an idea for what your program can be used for. Example a traffic light. Provide an image or video on your wiki and a link to your code.

#Week 10

Class 19 - April 4

###Basic Digital input example Examples => Digital => Button

Button

Class 20 - April 6

If Statements

Button Press

Example => Digital => Blink without Delay

Button Press with Counter

####Week 10 HW

Create a program with 2 switches that individually controls 2 LEDS. Use the Button Press with Counter

#Week 11

Class 21 - April 11

Changing states

####AnalogWrite- Understanding PWM

Class 22 - April 13

#####Arrays

####Analogread

####Week 11 HW

Write a program that cycles through 3 different modes. Modes can include ALL On, ALL OFF, or Various Sequences Use tones or an led sequence as an output.

#Week 12

Class 23 - April 18

Piezo

To connect the piezo or speaker connect one side to your digital pin and the other to ground. Use a 220ohm resistor to ground.

Class 24 - April 20

####Week 12 Homework

Create 5 output states for your game. Use LED or Sound Sequences or any other output.

#Spring Break - April 22 -29

#Week 13

Class 25 - May 2

####Arduino

####Python

Class 26 - May 4

####Serial Reader

#Week 14

Class 27 - May 9

Class 28 - May 11

#Week 15

Class 29 - May 16

Class 30 - May 18

#Week 16 - May 25 Final

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.