home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: sparky!uunet!timbuk.cray.com!hemlock.cray.com!sdm
- From: sdm@hemlock.cray.com (Stuart Mitchell)
- Subject: Help needed - Reading resistor values thru the gameport
- Message-ID: <1992Sep15.042256.7973@hemlock.cray.com>
- Originator: sdm@hemlock
- Lines: 39
- Sender: sdm@hemlock (Stuart Mitchell)
- Organization: Cray Research, Inc.
- Date: 15 Sep 92 04:22:56 CDT
-
-
- OK, sorry if this is a FAQ, but I've been playing with the POTGO stuff, and
- am trying to read in the setting of a potentiometer using the second gameport.
- I'm not having a lot of joy, and so thought I'd ask if anybody else had experience
- with this stuff or not, and hopefully set me on the right track.
-
- What I've done so far is as follows:
-
- 1. Made up a connector for the second gameport with the following circuit:
-
- 470 Ohm
- ------/\/\/\/\/\/\-------- open
- | ^
- | |
- | |
- pin 7 pin 9
- (+5V)
-
- (This is copied from the example in the hardware reference manual)
-
- 2. Copied the read9n5.c from the RKM examples, and modified it so that it
- does the call to AllocPotbits with START & DATRX flags set.
- Modified it again so that it does a WaitTOF(), WritePotgo(1,1) (to start
- the hardware doing the measurement of the resistance), and then after
- a second WaitTOF(), I read the value from POT1DAT ($000DFF014), and
- print it. This is then repeated in a loop.
-
- The values coming back seem to be fairly random, and don't appear to change
- in any correlation with my changing the resistance values of the pot.
- That's about as far as I got (at one o'clock in the morning) yesterday - anybody
- got any suggestions ?
-
- stuart
- (This is on an old amiga 500, 1.3 OS)
- --
- ___________ _ Mitchell's Law of Committees: (fortune cookie)
- (_ / ) ) Any simple problem can be made insolvable
- _____)tuart / / /itchell__ if enough meetings are held to discuss it.
- (sdm@uk.cray.com)
-