Printer port as analog switch (all on/all off) io
Printer port as analog switch (all on/all off) io
(OP)
Hello,
How would I go about turning all of the pins on my printer port on at the same time? I need to use it as an analog switch. I am adapting a program to interface with some lab equipment usind an A/D converter. Essentially, I need to make the port come on and stay on until the program cyles.
Thank You
qb101
qb101@oscartrapp.com
How would I go about turning all of the pins on my printer port on at the same time? I need to use it as an analog switch. I am adapting a program to interface with some lab equipment usind an A/D converter. Essentially, I need to make the port come on and stay on until the program cyles.
Thank You
qb101
qb101@oscartrapp.com
RE: Printer port as analog switch (all on/all off) io
A% = 0
OUT &H378, &H0
PRINT "Press `X' to quit"
start: A$ = INKEY$
IF A$ = "" THEN GOTO start
IF A$ = "1" THEN A% = A% XOR &H1
IF A$ = "2" THEN A% = A% XOR &H2
IF A$ = "3" THEN A% = A% XOR &H4
IF A$ = "4" THEN A% = A% XOR &H8
IF A$ = "5" THEN A% = A% XOR &H10
IF A$ = "6" THEN A% = A% XOR &H20
IF A$ = "7" THEN A% = A% XOR &H40
IF A$ = "8" THEN A% = A% XOR &H80
IF A$ = "X" OR A$ = "x" THEN END
OUT &H378, A%
GOTO start
Kim_Christensen@telus.net
http://www3.bc.sympatico.ca/Kim_Christensen/index.html
RE: Printer port as analog switch (all on/all off) io
value% = 0
DO
OUT &H378, value%
a$ = INPUT$(1)
value% = value% XOR (2 ^ (VAL(a$) - 1))
LOOP UNTIL LCASE$(a$) = "x"
Much more compact