[comp.sys.amiga.programmer] I need to read the Pots values in the POTGO resource. Help!

chymes@zug.csmil.umich.edu (Charles Hymes) (06/03/91)

I use basically the following lines to set up the POTGO resource.

potbits=AllocPotBits(OUTRY|DATRY|OUTRX|DATRX|START);             
/* Get the bits for port 1, pin 5 and 9 the Y and X POT registers
   on the alternate mouse port. */

WritePotgo(0x01L,potbits);
        /* Clear all data bits in the register but start the pot counter */

But reading the pots with the either of the following  lines don't give
me any values.

/*amplitude=(custom.potinp  & potbits);*/
/*amplitude=(pot1dat);*/

I tried other code as well, but the values at pot1dat never change no
matter what I do at the gameport. If I connect pins 5 or 9 to (the X
and Y pot pins) to pins 7 or 8 (+5 volts and Ground respectively)
Nothing changes at pot1dat.
Potinp changes the way you would expect it to, but I don't want on/off
values, I want the 8-bit values one expects from the Pots.

The (old white A1000) Hardware manual says that Potgo needs to be
reset each vertical blank, but it also says that that is taken care of
by the OS. Is this shut off when I use the POTGO resource?
I tryed the following line of C code after the line at wich I read the
registers but it didn't help. 
/*        WritePotgo(0x01L,potbits);*/ 

So whats the deal??!!!?

Charlweed Hymerfan