Presentation on theme: "Interfacing Project. Computer Controlled Car Left Headlight – D0 Right Headlight – D1 Left Taillight – D2 Right Taillight – D3."— Presentation transcript:
Computer Controlled Car Left Headlight – D0 Right Headlight – D1 Left Taillight – D2 Right Taillight – D3
The Wood Car Project Steps: 1) Wire-wrap four LED / resistor pairs 2) Attach the wires to the car 3) Connect the wired pairs to the D-Sub connector 4) Write your program 5) Enjoy hours of staring at the model flash.
Part I : Materials Materials: - wooden car - 4 x 220 Ohm resistors - 4 LEDs - Parallel Port Cable Thumb tacks, tape
Step 1 : Wire Head Lights Left Headlight – D0 Right Headlight – D1
Light Emitting Diodes LED’s will only work if they are installed in the right direction. Here is a way to tell which is the negative (- ’ve) lead. 1) –’ve lead is shorter
Step 1 – Wire Wrapping Wrap –’ve lead Trim ends of wires Fold wires flat
Step 2: Wire Taillights Left Taillight – D2 Right Taillight – D3
Wiring an LED +’ve, Long Lead
What does the circuit look like? parallelput(0) Switch is open, no path, LED off parallelput(1) Switch is closed, path exists, LED on Voltage from parallel port 220Ω Pin 2 Pin 18
Step 3 – The D-Sub Connector
Step 4 – Wiring the lights
Test your interface Once you’ve got the wires connected to the D-Sub connector, you can test the interface. Try : parallelput(255) This should turn on all your lights.
Binary on the Parallel Port parallelput(0) parallelput(1) parallelput(37) parallelput(255) The integer parameter is translated into binary and each bit corresponds to one of the data pins on the parallel port.
Test your interface Once you’ve got the wires connected to the D-Sub connector, you can test the interface. Load the “Simple Paper Car Interface.t” program found on your CD. Try running the program and verify if your interface is correct.
Sample Program #1
Sample Program #2
An Alternative: Wire-Wrapping You do not have to use breadboards for your interfacing projects. You can use wire-wrapping to connect your different components together. We’re breaking the rules of conventional wire-wrapping.
Setting up the car Left Headlight – D0 Right Headlight – D1 Left Taillight – D2 Right Taillight – D3