Go Down

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

seggi

 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 .
they cant read the steps.
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 .
please guide me.

Best Regards,
Seggi.

UKHeliBob

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

output of filter is connected to a2.

Robin2

please guide me.
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.

C'mon, if you want help you need to provide useful information.

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

UKHeliBob

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

Hello Guys,
Below i am posted the code for this

void overrange()
{
  overval=analogRead(A2);
  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 am Last 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?

What is "visigenie", post a link please.

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 am Last 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