Computer Engineering Activities Interfacing Music Box Project ACSE 2004 - PowerPoint PPT Presentation

1 / 52
About This Presentation
Title:

Computer Engineering Activities Interfacing Music Box Project ACSE 2004

Description:

Drag strips. Music Box. Latches. Marquees. GUIs/Mouse Control. Introduction to Traffic Lights ... Cable 1 D sub to Breadboard. Four N.O. pushbuttons. Four ... – PowerPoint PPT presentation

Number of Views:53
Avg rating:3.0/5.0
Slides: 53
Provided by: graham61
Category:

less

Transcript and Presenter's Notes

Title: Computer Engineering Activities Interfacing Music Box Project ACSE 2004


1
Computer Engineering ActivitiesInterfacingMusic
Box ProjectACSE 2004
  • Graham Smyth

2
Computer Engineering Units
  • Grade 10/11/12
  • 1. Hardware
  • 2. Networking
  • 3. Integrated Circuits
  • 4. Programming
  • 5. Interfaces

3
Interfacing Activities
  • Grade 10
  • One bit
  • Three LEDs
  • LED simulators
  • ASCII
  • Binary counting
  • Light patterns
  • Intersections
  • AC ???
  • Grade 11
  • One bit
  • One byte
  • DC motor
  • Bi-directional
  • LED traffic light
  • LED intersection
  • Demultiplexer
  • GUIs
  • Mouse control
  • AC ??

4
Interfacing Activities
  • Grade 12
  • One byte
  • LED intersection
  • Stop Lights AC?
  • Vehicles
  • Security systems
  • Drag strips
  • Music Box
  • Latches
  • Marquees
  • GUIs/Mouse Control

5
Introduction to Traffic Lights
6
Traffic Lights
7
Traffic Lights
8
Introduction to Motors
9
Motors
10
Introduction to Music
11
Music Box
Note indicator Light
Note push button
12
Music Pipe Organ
13
Breadboard Connections
Connected
High Fives
Divider
Low Fives
Connected
14
Music Box Software
Turing
  • parallelput(number) - reads 8 pins
  • put parallelget - reads 5 pins
  • mousewhere(x,y,click)
  • play(CDEFG)
  • drawline(x1,y1,x2,y2,red)
  • FREE!!!

15
Interfacing System Unit 5
Computer Interface Peripheral
  • Parallelport
  • Wires
  • ICs
  • Resistors
  • Capacitors
  • Transistors
  • LED's
  • Motors
  • Lights
  • Robots
  • Music Box
  • Joysticks

Wires
Wires
16
Music Box Hardware
  • Five male pins
  • One D sub connector
  • Cable 1 D sub to Breadboard
  • Four N.O. pushbuttons
  • Four Resistors (Brown/Black/Orange)
  • One Breadboard
  • Extra wire
  • Enhancement hardware ????

17
Music Box Hardware - Resistor(Four Required)
1 0 X 103
Brown Black
Orange Gold
Tolerance -5
18
Resistor Chart
19
Music Box Hardware Cable D sub to Breadboard
Male Pin
Insulated Wire
Small Crimp Tab
Stripped Wire
Large Crimp Tab
20
3 Pair Cable
White/Green Green/ White Orange/
White White/Orange Blue/ White White/ Blue
21
Cable with Male Pins
22
Music Box HardwareNormally Open Switch
Schematic
Physical
1
1
2
2
23
Inputting Data
24
Music Box Hardware Parallelport
Input I0 I3
Output D0 D7
13 12 11 10 9 8 7 6
5 4 3 2 1
25 24 23 22 21 20 19 18 17
16 15 14
Input I4
Grounds 18 - 25
View from back of Computer
25
D Sub Connector /Harness
26
D Sub Connector Colour Code
27
D Sub Connector
Pin 10
Pin 2
D sub Connector
Pin 18
28
D Sub Connector
Pin 2
Check
Bottom, 2 Down
29
D Sub Connector
Check
Pin 2, Bottom, 2 Down
Pin 18, Top, 5 Down
Pin 10, Bottom, 10 Down
Pin 11
Pin 12
Pin 13
Total of six wires from D sub connector
30
Breadboard
Switches Span Divider
31
Breadboard with Resistors
Resistors to Top Rail
Brown/Black/Orange
Align
32
D Sub to Breadboard Cable
To Pin 2 White/Green
Four Wires
To Pin18 White/Blue
Switch to Ground
33
D Sub to Breadboard Cable
Pin 10 Green/ White
Pin 11 Orange/ White
Pin 12 White/Orange
Pin 13 Blue/ White
Pin 2 White/Green
Pin18 White/Blue
34
The hardware is complete. Now to the software
35
Music Box Software Assignment 1
Write a program that will continuously scan for
input values from the MUSIC BOX.
36
Music Box SoftwareAssignment 1
parallelput(1) loop Start of infinite loop.
put parallelget Returns input pin
values. end loop End of loop.
37
Music Box Note Matrix
Remember these Numbers
38
Music Box Software Assignment 2
Write a program that will play the notes CDEG
each as quarter notes.
39
Music Box Software Assignment 2
parallelput(1) var value int loop value
parallelget if value ______ then play
(C) elsif value _____ then play
(D) Etc Save as MusicBox2
40
Music Box Software Assignment 3
Write a program that will play the notes CDEG
each as quarter notes and at the same time
display a GUI representing the played notes.
41
Adding Graphics Screen
(640,400)
(0,0)
42
Music Box Software Assignment 3 A GUI part 1
  • locatexy (300, 300)
  • put "MUSIC BOX PLAYER"
  • locatexy (200, 140)
  • put "C D E G"
  • drawing 4 circles with perimeter black
  • drawoval (200, 200, 40, 40, black)
  • drawoval (300, 200, 40, 40, black)
  • drawoval (400, 200, 40, 40, black)
  • drawoval (500, 200, 40, 40, black)

43
Music Box Software Assignment 3 A GUI part 2
  • filling 4 circles with white
  • drawfilloval (200, 200, 40, 40, white, black)
  • drawfilloval (300, 200, 40, 40, white, black)
  • drawfilloval (400, 200, 40, 40, white, black)
  • drawfilloval (500, 200, 40, 40, white, black)

44
Music Box Software Assignment 3 A GUI part 3
  • parallelput(1)
  • var value int
  • loop
  • value parallelget
  • if value ______ then
  • fills C GUI with red
  • drawfilloval (200, 200, 40, 40, red, black)
  • plays C for a quarter note
  • play C
  • sets C GUI back to white
  • drawfilloval (200, 200, 40, 40, white, black)

45
Music Box Software Assignment 3 A GUI part 4
  • elsif value _____ then
  • fills D GUI with red
  • drawfilloval (300, 200, 40, 40, red, black)
  • play D
  • sets D GUI back to white
  • drawfilloval (300, 200, 40, 40, white, black)
  • Similarly for notes E and G

Save as MusicBox3
46
Music Box Tune
  • Mary Had a Little

Mary had a little lamb E D C D E E E
rest Little lamb D D D rest Little lamb E G
G rest Mary had a little lamb E D C D E
E E rest Whose fleece was white as snow E
D D E D C
Save as MusicBox4
47
Music Theory
  • play (8CDEFGABgtC) plays one octave of 8th
    notes from middle C
  • play(ltBAGFEDC) plays scale in reverse in 8th
    notes if it follows previous line
  • play (gt4CDEFGAB) plays one octave of quarter
    notes one octave up from middle C
  • play ("gt6CpCpC-") plays one octave up from
    middle C, a C 16th note, a rest, C sharp, a rest,
    and a C flat
  • play(1C2C4C6C) plays whole, half, quarter,
    and 16th C note

48
Music Box Software Assignment 4
  • Write a program that will
  • play a tune
  • display a GUI of the notes being played
  • change the colour of the note name.

Save as MusicBox5
49
Music Box Software Assignment 5
Write a program that will automatically play
Mary Had a Little Lamb.
Save as MusicBox6
50
Additional Music Box Software
  • Additions
  • Add an LED above each key on the keyboard
  • Add additional keys to the keyboard
  • Store a tune
  • Test a users ability to replay the tune

51
More Hands-On Activities
  • Keyboard
  • Intersection
  • Robot
  • Worlds Largest Joystick

52
Addresses
smythel_at_mnsi.net www.classictechnology.ca www.ho
ltsoft.com
Write a Comment
User Comments (0)
About PowerShow.com