
-----------------------------------
sjb
Sat Jan 14, 2006 11:09 am

IR Sensor and Emitter
-----------------------------------
Hi, I'm making a security system for a physics ISU, and i used the book Networks, Interfaces, and integrated circuits and in it, it has the program intruder alert (10.6.8) anyways, ive hooked the whole thing up...and it does not work, ive been troubleshooting for 2 weeks now and i cant find the problem, and its due on thursday, unfortunately the course thats associated with the book is not done at my school so i cant ask a teacher, so I am hoping someone here will be able to help me..

the program is at the bottom if you want to look at it but whats supposed to happen is that D0 on the parallel port is supposed be activated when you click arm with parallelput (1) and the reciever recieves the signal from the emitter and sends back to the computer that its recieving a signal, so the computer states that there are intruders, however if this signal is broken it sets off a buzzer.

My problem is, the infrared emitter and detector arent doing anything, the parallelget command from what ive seen, always stays constant, and nothing is changing it....
i did a small program on the side to see what the parallelget was coming to and it was 120.... so im guessing my numbers are different than the ones they assumed but i dont know what to do with these numbers or how to get the IR sensor and emitter to work

% The "IntruderAlert" program

%D0 (pin2) sends power to the emitter.
%D1 (pin3) activates the IR been when the Arm boxis clicked
%I0 (pin10) connects to the IR receiver. I0 is 1 id the emitter is given
%power and the IR receiver is receiving the bea.

% These are the locations of the boxes. (x1,y1) is the lower left corner
% of the box and (x2,y2) is the upper-right corner.

const armBoxX1 := 20
const armBoxY1 := 270
const armBoxX2 := 80
const armBoxY2 := 310
const disarmBoxX1 := 20
const disarmBoxY1 := 210
const disarmBoxX2 := 80
const disarmBoxY2 := 250
const quitBoxX1 := 20
const quitBoxY1 := 150
const quitBoxX2 := 80
const quitBoxY2 := 190

% For this computer, 63 means that light is shining on the reciever.
% The receiver is receiving light from the emitter.
% For this computer, 127 means that light is not shinning on the receiver.
% The beam is broken.

setscreen ("graphics")

% x,y is the mosition of the mouse.
% button is the variable determining if the mouse button is pressed.
var x, y, button : int
var value : int
% armed indicates whether or not the alarm is currently armed
var armed : boolean := false

% Draws the titles.
colour (red)
locatexy (230, 380)
put "Home Security System"
locatexy (0, 320)
colour (black)
put "Control Panel"


% Draws the "Quit" box.
drawbox (quitBoxX1, quitBoxY1, quitBoxX2, quitBoxY2, black)
locatexy (quitBoxX1 + 20, quitBoxY1 + 20)
colour (black)
put "Quit" ..

% Draws the "Disarm" box.
drawbox (disarmBoxX1, disarmBoxY1, disarmBoxX2, disarmBoxY2, green)
locatexy (disarmBoxX1 + 10, disarmBoxY1 + 20)
colour (green)
put "Disarm" ..

% Draws the "Arm" box.
drawbox (armBoxX1, armBoxY1, armBoxX2, armBoxY2, red)
locatexy (armBoxX1 + 20, armBoxY1 + 20)
colour (red)
put "Arm" ..

loop
    % Locates the current mouse position
    mousewhere (x, y, button)
    if quitBoxX1 