1 / 52

Computer Engineering Activities Interfacing Music Box Project ACSE 2004

Computer Engineering Activities Interfacing Music Box Project ACSE 2004. Graham Smyth. Computer Engineering Units. Grade 10/11/12 1. Hardware 2. Networking 3. Integrated Circuits 4. Programming 5. Interfaces. Interfacing Activities. Grade 10 One bit Three LEDs

elmer
Download Presentation

Computer Engineering Activities Interfacing Music Box Project ACSE 2004

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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 BrownBlackOrangeGold 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 Hardware:Normally 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 Grounds 18 - 25 Input I4 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 GUIpart 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 GUIpart 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 (“8CDEFGAB>C”) – plays one octave of 8th notes from middle C • play(“<BAGFEDC”) – plays scale in reverse in 8th notes if it follows previous line • play (“>4CDEFGAB”) – plays one octave of quarter notes one octave up from middle C • play (">6CpC+pC-") – 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

More Related