home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / amiga / programm / 13373 < prev    next >
Encoding:
Text File  |  1992-09-14  |  2.0 KB  |  51 lines

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