Go Down

### Topic: problem on analogrRead function (Read 408 times)previous topic - next topic

#### seggi

##### Dec 10, 2018, 07:49 am
Hello Guys,

i am using the arduino nano board and read the a2 pin .
i am using the visigenie library .

whenever i check the voltage on pin through the hardware i was gotten the 0.180V minimum and 0.608V
Maximum.

and i am trying to do is on a minimum voltage i.e. 0.180 i have fixed it the resolution steps i.e.1023/5*0.180=36.82 steps
and on Maximum 1023/5*0.608=124.3steps

i am doing the if steps is less then the 50 steps on a genie display led is off and greater then 120 steps led will be on .

but they behaving inappropriately .
the steps are continuously changes and i am getting the no difference on minimum voltage or maximum voltage .

How can i fix it these problem .

Best Regards,
Seggi.

#### UKHeliBob

#1
##### Dec 10, 2018, 09:09 am
Quote
0.180V minimum and 0.608V
Maximum.
What is connected to A2 and how is it wired to GND and a voltage source ?
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

#### seggi

#2
##### Dec 10, 2018, 09:45 am
output of filter is connected to a2.

#### Robin2

#3
##### Dec 10, 2018, 09:50 am
How can we guide you when you have not posted your program nor have you given any details of the output of the progrram.

And what on earth does "output of filter" mean.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

#### UKHeliBob

#4
##### Dec 10, 2018, 11:34 am
output of filter is connected to a2.
What filter would that be and how is it connected ?
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

#### seggi

#5
##### Dec 11, 2018, 07:08 am
Hello Guys,
Below i am posted the code for this

void overrange()
{
delay(100);
genie.WriteStr(2, overval);
delay(100);
if (overval>=102)
{
genie.WriteObject(GENIE_OBJ_USER_LED, 2, 1);
}
else if (OverRange <= 100)
{
genie.WriteObject(GENIE_OBJ_USER_LED, 2, 0);
}
}

#### TomGeorge

#6
##### Dec 11, 2018, 08:48 amLast Edit: Dec 11, 2018, 08:48 am by TomGeorge
Hi,

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Did you write your code in stages, getting each stage working before starting the next?

Have you written some SIMPLE code that JUST READS A2 and sends the result to the Serial Monitor.

Lets first see if the problem is the input, forget about "visigenie" and everything else.

Tom.....
Everything runs on smoke, let the smoke out, it stops running....

#### Robin2

#7
##### Dec 11, 2018, 09:11 amLast Edit: Dec 11, 2018, 09:12 am by Robin2
Hello Guys,
Below i am posted the code for this

That is not a complete program. Problems are often in the other part - else you would have already found them.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up