Main Site Documentation

Potentiometer value


#1

Hello! I
have connected (via designer) a potentiometer module (GHI-POT-GM-275) to a hydra:

// Initialize GTM.Modules and event handlers here.		
			potentiometer = new GTM.GHIElectronics.Potentiometer(14);

Inside a timer event I read potinetomter value:

uint percent = ( uint )( potentiometer.ReadPotentiometerPercentage ( ) * 100 );

I get always the same value, even if I change the potentiometer value. What I do wrong?
Thanks for help!


#2

What happens if you print the value as is?


#3

I get always (percantege / voltage):

56 / 1.869140625
56 / 1.8626953124999999
57 / 1.88525390625
56 / 1.85625
57 / 1.8949218749999999
55 / 1.8369140625
57 / 1.8949218749999999
56 / 1.8659179687499998
56 / 1.8788085937499999
56 / 1.869140625
56 / 1.85625
56 / 1.8788085937499999
55 / 1.8498046874999998
57 / 1.8949218749999999
55 / 1.8433593749999999
57 / 1.88525390625
56 / 1.87236328125
56 / 1.87236328125
56 / 1.8788085937499999
56 / 1.8659179687499998
57 / 1.8884765625
55 / 1.84013671875
57 / 1.8916992187499999


#4

Which socket?


#5

Socket 14:
potentiometer = new GTM.GHIElectronics.Potentiometer(14);


#6

I think, it ist damaged ;( A another one works flawlessly…
Sorry for the question, I could not find antoher one (earlier).


#7

The pot is? This is strange. There is only couple of traces on the board. Maybe do a quick visual inspection.


#8

The pot isn’t burned :wink: I will test it wit a extender module and then measure the voltages. I hope, it ist a possible way…


#9

Can you measure the resistance as you twiddle the pot?