MichaelCollier
Banned
Here is a really simple gun and target project. The range can be improved by using multiple IR transmitters, it is usable to about 30 feet.
The range can be extended by placing a lens (i.e. from a camera) over the transmitter, but this seemed to require a more accurate aim to hit the target, maybe because the IR field is narrower.
It has two parts, the Gun and the Target.
Gun
Target
The range can be extended by placing a lens (i.e. from a camera) over the transmitter, but this seemed to require a more accurate aim to hit the target, maybe because the IR field is narrower.
It has two parts, the Gun and the Target.
Gun
Code:
REM Infrared Gun and Target Game
REM Author: Michael Collier
REM This simple project transmits an infrared signal mounted
REM on a toy gun towards an infrared receiver circuit.
forever:
REM Transmit value "2"
REM make sure to use device id of "1"
INFRAOUT 1 , 2
GOTO forever
Code:
REM Infrared Target Game
REM Target Code
REM Author: Michael Collier
Forever:
REM Turn Off Target Hit Light
LOW 0
INFRAIN2
If B13 <> 2 then Forever
REM Turn On Target Hit Light for 10 ms
HIGH 0
PAUSE 10
GOTO Forever
Attachments
-
65.8 KB Views: 225
-
72.4 KB Views: 231