Here is my project in a nut shell: I have a game called Star Wars X-Wing Miniatures. The main web page is: here. I plan on making a play table that has inputs from two cannibalized joysticks and their buttons, two reed relays, a missile switch. The outputs will be: two servos or DC motors; 3 red bar graph displays; 3 amber bar graph displays; one blue bar graph display; and an mp3 shield from adafruit.
I am trying to incorporate an Arduino Mega 2560 with the computer interface we made for Microprocessor class. We are using QBASIC to write the program that will read sensors, control motors; pneumatics; lights; relays; etc..
The PCI card is plugged into the expansion slot. from the expansion slot it goes to the bread board. we are only using 10 of the 32 lines on the address bus. The expansion slot is identified as the port 30016 or 1100000002 or 76810.
My professor says we do not need to use AND gates when we are outputting to any output other than 1, 2, 4, 8, 16, 32, 64, and 128. We can have outputs from 1 to 255. So, say you are outputting to 3, the code may look like this:
10 OUT 768, 3 REM output to interface data line 3
20 SLEEP 1 REM wait one second
30 OUT 768, 0 REM turns off all outputs
40 SLEEP 1 REM wait one second
50 GOTO 10 REM go to line 10
"REM" is short for remark or comment.
What I am asking is can the Arduino differentiate between output 1 and output 3? or do I need an AND gate for the Arduino to only be activated by the output of data line 1 and 2 (which combine to make output 3)?
I have attached the a screen shot of the interface schematic.
I can send the multisim file, if somebody can open it and view it. PM your email for the file.
Ok, I will try again. How do I do an and operation? Is it possible to have the two to eight 5v signals going to a single digital pin or do I have to put each one to its own pin?
Another question I have is: how do I slow down a DC motor? I tried resistors, but all that did was prevent the motor from receiving enough voltage. Do I lower the amperage? If not, what do I alter to get a slower RPM?