ParralelPut Help
Author |
Message |
umaza
|
Posted: Wed Jan 11, 2012 12:39 pm Post subject: ParralelPut Help |
|
|
What is it you are trying to achieve?
I need to make a 4-way instersection and need four spotlights by using LEDS through a parralelport using turing
What is the problem you are having?
I can't get both reds to stay on, then turn one red off and keep the other on.
Describe what you have tried to solve this problem
I tried parallelput (0) but that turns both red off
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Turing: |
%Information about the program: This program is -
%-intended to demonstrate the traditonal traffic light patterns viewed around the world in different parts of the world.
%The traffic light embodies the traditonal light pattern of turning red, then green, finally yellow, and continuing this pattern.
% Outline of traffic box
drawfillbox (100, 60, 250, 370, yellow)
Draw.FillBox (300, 60, 250, 370, gray)
% Creates a circle with the outline and fill of black.
drawfilloval (175, 315, 35, 35, 255)
% Creates a circle with the outline and fill of black.
drawfilloval (175, 225, 35, 35, 255)
% Creates a circle with the outline and fill of black.
drawfilloval (175, 135, 35, 35, 255)
% Outline of traffic box
drawfillbox (275, 60, 250, 370, gray)
% Creates a circle with the outline and fill of black.
drawfilloval (275, 315, 35, 35, 255)
% Creates a circle with the outline and fill of black.
drawfilloval (275, 225, 35, 35, 255)
% Creates a circle with the outline and fill of black.
drawfilloval (275, 135, 35, 35, 255)
% Creates a circle with the outline and fill of black.
drawfilloval (375, 315, 35, 35, 255)
% Creates a circle with the outline and fill of black.
drawfilloval (375, 225, 35, 35, 255)
% Creates a circle with the outline and fill of black.
drawfilloval (375, 135, 35, 35, 255)
% Creates a circle with the outline and fill of black.
drawfilloval (475, 315, 35, 35, 255)
% Creates a circle with the outline and fill of black.
drawfilloval (475, 225, 35, 35, 255)
% Creates a circle with the outline and fill of black.
drawfilloval (475, 135, 35, 35, 255)
loop
delay (2000)
%parallelput (1) %The parallelput procedure is used on a PC to set the values on the data pins on the parallel port. In this case turn on our pin number 2 on the parallel port.
%parallelput (2) %The parallelput procedure is used on a PC to set the values on the data pins on the parallel port. In this case turn on our pin number 2 on the parallel port.
drawfilloval (175, 315, 35, 35, 12)%This line of code identifies the circle intended for the red sign and fills the circle with bright red color (12).
drawfilloval (275, 315, 35, 35, 12)%This line of code identifies the circle intended for the red sign and fills the circle with bright red color (12).
end loop
|
(Can't get only one to turn off)
Please specify what version of Turing you are using
Latest Version |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Wed Jan 11, 2012 1:02 pm Post subject: RE:ParralelPut Help |
|
|
You need to pick the pins that you want to be on, then calculate the number that corresponds to that particular configuration of pins. That is, all of the changes will execute in a single statement of parallelput(state_value)
See parallelput for details. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
|
|