110 likes | 321 Views
Interfacing Introduction. Interfacing Overview. Computer. Peripheral. Interface. Wires ICs Resistors Capacitors Transistors Connectors. LEDs Motors Lights Robots Joystick Music Box. Parallel Port Pinout. Graphic from http://www.doc.ic.ac.uk/~ih/doc/par/. Output Table.
E N D
Interfacing Overview Computer Peripheral Interface • Wires • ICs • Resistors • Capacitors • Transistors • Connectors • LEDs • Motors • Lights • Robots • Joystick • Music Box
Parallel Port Pinout Graphic from http://www.doc.ic.ac.uk/~ih/doc/par/
Turing: Preparing for Interfacing • Turing is already prepared for interfacing with the parallel port • No preparation necessary!
Turing: Turning On the LED • Parallelput(value) • Parallelput(1) turns on the 1 bit (D0) • Parallelput(255) turns on all bits (D0-D7)
Turing: Turning Off the LED • Parallelput(0)
Turing: Flashing the LED loop parallelput (1) delay (250) parallelput (0) delay (250) end loop
Turing: LED Walking loop % loops up for i : 0 .. 7 parallelput (2 ** i) delay (500) end for % loops down for decreasing i : 6 .. 1 parallelput (2 ** i) delay (500) end for end loop