computer engineering activities the joystick project beit 2003 graham smyth yungsiow yang jerry...
TRANSCRIPT
Computer Computer Engineering Engineering
ActivitiesActivitiesThe Joystick ProjectThe Joystick Project
BEIT 2003BEIT 2003Graham Smyth Graham Smyth
Yungsiow YangYungsiow Yang
Jerry DolataJerry Dolata
Kevin SheaKevin Shea
Ilana SmythIlana Smyth
Computer Engineering Computer Engineering UnitsUnits
Grades 10/11/12
1. Hardware1. Hardware
2. Networking2. Networking
3. Integrated Circuits3. Integrated Circuits
4. Programming4. Programming
5. 5. InterfacesInterfaces
Interfacing ActivitiesInterfacing ActivitiesGrade 12
• One byte• LED intersection• Stop Lights AC?• Vehicles• Security systems• Drag strips• Music Boxes• Joysticks• Marquees• GUIs/Mouse Control
World’s Largest Portable World’s Largest Portable JoystickJoystick
Claim ID: 38433 Claim ID: 38433 Membership Number: 37096 Membership Number: 37096
05 June 2003 05 June 2003
Dear Mr Smyth Dear Mr Smyth Thank you for sending us the details of your recent record attempt for 'Largest Thank you for sending us the details of your recent record attempt for 'Largest Joystick'.I am afraid to say that we are unable to accept this as a Guinness Joystick'.I am afraid to say that we are unable to accept this as a Guinness World Record.World Record.Unfortunately our research team have concluded that your attempt does not Unfortunately our research team have concluded that your attempt does not conform to our manufactured articles guidelines as there is no commercially conform to our manufactured articles guidelines as there is no commercially available joystick which looks like a small version of this.available joystick which looks like a small version of this.I appreciate that this may be disappointing to you, but I hope that this does not I appreciate that this may be disappointing to you, but I hope that this does not deter you from trying again. We are always keen to hear from people who wish deter you from trying again. We are always keen to hear from people who wish to set a Guinness World Record. If you should need any advice regarding to set a Guinness World Record. If you should need any advice regarding breaking an existing record or setting a new Guinness World Record please breaking an existing record or setting a new Guinness World Record please contact us again through our website or directly quoting the above membership contact us again through our website or directly quoting the above membership number.number.Once again thank you for contacting Guinness World Records. We wish you Once again thank you for contacting Guinness World Records. We wish you every success with any future record-breaking endeavours.every success with any future record-breaking endeavours.
Yours sincerely, Yours sincerely, Sophie Whiting Sophie Whiting
Records Research Services Records Research Services
Computer Computer Interface Peripheral Interface Peripheral
Interfacing SystemInterfacing SystemUnit 5
• Parallelport • Wires• ICs• Resistors• Capacitors• Transistors
• LED's• Motors• Lights• Robots• Joysticks
Software Hardware Hardware
Joystick SoftwareJoystick 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!!!
Joystick HardwareJoystick Hardware
• Five male pins • One D sub connector • Cable 1 – D sub to Breadboard• Cable 2 – Breadboard to Joystick • One N.O. pushbutton
• One Doorstop• Five Resistors (Brown/Black/Orange)• Four Small pipes• One Block of wood• One Breadboard
Joystick Hardware - ResistorJoystick Hardware - Resistor(Five Required)
Brown Black Orange Gold
1 0 X 103
Tolerance+-5%
Resistor ChartResistor Chart
BAND 1 BAND 2 BAND 3 BLACK 0 0 1 BROWN 1 1 10
RED 2 2 100 ORANGE 3 3 1 000 YELLOW 4 4 10 000 GREEN 5 5 100 000 BLUE 6 6 1 000 000
VIOLET 7 7 10 000 000 GRAY 8 8 100 000 000 WHITE 9 9 1 000 000 000
Cable 1: D sub to BreadboardCable 1: D sub to Breadboard
Male Pin Insulated Wire
Large Crimp Tab Stripped Wire
Small Crimp Tab
D sub to Breadboard CableD sub to Breadboard Cable
White/GreenGreenBrown
Blue
White/Brown
Orange
White/Blue
White/Orange
Joystick Hardware : ParallelportJoystick Hardware : Parallelport
View from View from backback of Computer of Computer
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
OutputD0 – D7
InputI0 – I3
Input I4 Grounds18 - 25
Joystick Hardware:Joystick Hardware:Normally Open Switch Normally Open Switch
1
2
1 2
Physical Schematic
D Sub Connector Colour Code D Sub Connector Colour Code
Pin Pin ##
ColourColour
22 BrownBrown
1010 GreenGreen
1111 OrangeOrange
1212 BlueBlue
1313 White/White/GreenGreen
1515 White/White/OrangeOrange
1818 White/White/ Blue Blue
D Sub to Breadboard CableD Sub to Breadboard Cable
Pin13 White/Green
Pin12 Blue Pin11 Orange
Pin10 Green
Pin18 White/Blue
Pin15 White/Orange
Pin 2 Brown
Total of seven wires from D sub connector
Breadboard with ResistorsBreadboard with Resistors
Resistors to Top Rail Brown/Black/
Orange
Resistors to Any Column
D Sub to Breadboard Cable D Sub to Breadboard Cable
To Pin11(Orange)
To Pin12(Blue)
To Pin13White/Green
To Pin18 White/Blue
To Pin15White/Orange
To Pin 2Brown
Total of seven wires from D sub connector
To Pin 10
Green
Joystick – Top ViewJoystick – Top ViewFire
Button
Top Rail
Left Rail
Right Rail
Bottom Rail
Joystick
Joystick CableJoystick Cable
1. Run the White/Orange and the White/Blue wire into fire button hole
2. Attach the White/Orange wire to one pin of fire button
3. Attach the White/Blue wire to the second pin of fire button
Joystick Cable continuedJoystick Cable continued4. Attach a short White/Blue wire to the second
pin of fire button
5. Run the other end of this White/Blue wire into the joystick hole
6. Insert the fire button into the block
7. Wrap short White/Blue wire around the screw in the base of the door stopper
8. Screw base of door stopper into the bottom of the joystick hole
Joystick Cable continuedJoystick Cable continued9.Run the Green, Orange, Blue, and
White/Green wires into the joystick hole
10. Wrap Green wire around Top rail
11. Attach Orange wire around Bottom rail
12. Attach Blue wire around Left rail
13. Attach White/Green wire around Right rail
14. Screw door stopper into base
15. Insert the 4 rails into their appropriate locations
Connecting JoystickConnecting Joystickto Breadboardto Breadboard
Method:
Match the colour of the seven wires already in the breadboard with the colour of the six wires coming from the joystick.
Next diagram is messy, sorry
Joystick to BreadboardJoystick to Breadboard Six wires from Joystick
Previous seven wires from D Sub
1 2 3 4 5 6
Inputting Software Inputting Software Assignment 1Assignment 1
Write a program that will continuously scan for input values from the parallelport.
Inputting SoftwareInputting SoftwareCode 1Code 1
parallelput(1)loop % Start of infinite loop. put parallelget % Returns input pin values.end loop % End of loop.
Inputting Data Matrix: Part 1Inputting Data Matrix: Part 1
Part Position Parallelget Value
1 Neutral
2 Up
3 Down
4 Left
5 Right
6 Up/Left
7 Up/Right
8 Down/Left
9 Down/Right
Inputting Data Matrix: Part 2Inputting Data Matrix: Part 2
Part Position Parallelget Value
10 Fire/Neutral
11 Fire/Up
12 Fire/Down
13 Fire/Left
14 Fire/Right
15 Fire/Up/Left
16 Fire/Up/Right
17 Fire/Down/Left
18 Fire/Down/Right
Inputting Software Inputting Software Assignment 2Assignment 2
Write a program that will:• Display “UP” when the joystick is moved up• Display “DOWN” when the joystick is moved down• Display “LEFT” when the joystick is moved left• Display “RIGHT” when the joystick is moved right• etc
Inputting Software Solution Inputting Software Solution Assignment 2Assignment 2
parallelput(1)var value : intloop
value := parallelgetif value = ______ then
put “UP”elsif value = _____ then
put “DOWN”
etc
Inputting Software Inputting Software Assignment 3Assignment 3
Write a program that will:• Draw 8 arrows (compass points) and a fire button • Randomly highlight one of the 8 arrows and/or the fire button• Time how long it takes the user to match the prompt with the corresponding joystick movement• Repeat 20 times• Output the total time taken for all 20 matches• ?????? Additions ??????
More Hands-On ActivitiesMore Hands-On Activities
•Keyboard•Intersection•Robot•World’s Largest Joystick