Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 15:46 28 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Reading a Maximite Pin doesn’t work

Author Message
mcmichael
Newbie

Joined: 03/11/2013
Location: Germany
Posts: 2
Posted: 09:31pm 30 Nov 2013
Copy link to clipboard 
Print this post

Hi Experts,

I'm trying to read values from a pin and all I'm getting are rubbish values.

In the program I wrote:

SETPIN 1,1
PRINT PIN(1)

I connected a variable resistor (potentiometer) to GND, 5V and I/O Pin 1.

The values jump from 0.1 to 0.7 and are not referenced to the input value.

What am I doing wrong?

Thanks,
Michael
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1873
Posted: 10:13pm 30 Nov 2013
Copy link to clipboard 
Print this post

Michael,
Try

SetPin 1,1
V=Pin(1)
Print V
Paul.

"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1873
Posted: 11:51pm 30 Nov 2013
Copy link to clipboard 
Print this post

Michael,
Your code should work the only reason I suggested the change is because it is what I have used to read the value from a temperature sensor, and it works fine.
But I just had a thought, make sure you have actually connected to pin 1 it can get confusing. If pin 1 is floating you probably will get funny readings.
Paul.
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6100
Posted: 09:34am 01 Dec 2013
Copy link to clipboard 
Print this post

Pin 1 has a maximum allowed input of 3.3V. Connect your pot to 3.3, not 5V.

With the readings your are getting, I agree with Paul, you have an open circuit or floating input.

Jim

VK7JH
MMedit   MMBasic Help
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 02:59pm 01 Dec 2013
Copy link to clipboard 
Print this post

Another possibility is your Gnd reference. Are you using the Maximite Gnd and 3.3v - if not, try them.

Greg
 
mcmichael
Newbie

Joined: 03/11/2013
Location: Germany
Posts: 2
Posted: 06:17am 02 Dec 2013
Copy link to clipboard 
Print this post

Hello Experts,

thank you vermy much for your replies - I've found the mistake.
It was none of the leads you mentioned - I looked at
the connection diagram the wrong way around.

Now everything is fine and my joystick is working.

have a good time!

Bye,
Michael
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024