Value = analogRead(A0)

I need to know whta's the value of this:

pinmode(A0,OUTPUT)
digitalwrite(A0,HIGH)
pinmode(A0,INPUT)
value=analogread(A0) -----> what's the value of this?

Have you tried it?

I'll need it for my lessons exercice because it's more difficult and all my class couldn't resolve then. We can't use an arduino for solve this... please help me

Your code won't compile (for many reasons), so your question is moot.

I'll be happy to run it if you are kind enough to provide a complete sketch.

what's the reasons that this won't compile?

vinnycss:
what's the reasons that this won't compile?

There are no semicolons terminating the statements.

...and the functions are incorrectly spelled (unless there's other code you haven't posted)

Imagine that "," is ";" ... what's the problem to compile the program? (I know this is an incomplete program but and if It'll be complete)

vinnycss:
Imagine that "," is ";" ... what's the problem to compile the program? (I know this is an incomplete program but and if It'll be complete)

Wow, unbelievable. The problem seems to be that you have no idea of C/C++ syntax. Look at some example sketches, come back with a plausible program, and then we can help you. Here is the reference page.

The question made by the teacher of mantenitence and I don't know about C/C++ syntax... So, I anwer to know the result and solve then... Please, help me...

vinnycss:
The question made by the teacher of mantenitence and I don't know about C/C++ syntax... So, I anwer to know the result and solve then... Please, help me...

We're on a hamster wheel here. You have been told that it won't compile. So the answer is, there can be no value for "value". There is no result. It's a trick question. :wink:

It's typical for students to "not know things". That's why they study. :wink:

OK, let's assume that:

  1. the functions are correctly spelled
  2. there are semicolons where semicolons should be
  3. you have a "setup()" and a "loop()"
  4. you have a board to download to; let's say it's a bare Uno, connected only to the host PC via USB

What do you think the value of "value" is?

(Be careful, this too may be a trick question)

The question made by the teacher

What exactly did he/she ask ?

Even with the syntax and function names corrected and run in the setup() function of a minimal Arduino program there is no definitive answer because it depends on the electrical environment around pin A0.

My teacher said that:
_ I need that you can solve this question: what’s the value of “value”.
So, he don’t specific what’s the rest of the program… He said only the things that I wrote when I started this post…
He didn’t write more about the question…

https://www.arduino.cc/en/Reference/AnalogRead

As hinted before, analogRead() returns a number proportional to the voltage on the specified pin, from 0 to 1023.

He said only the things that I wrote when I started this post

If he wrote it exactly as you did then the answer is that the program will not compile no matter what else is in the program, even functions with the names give, because of the lack of trailing semicolons.

vinnycss:
My teacher said that:
_ I need that you can solve this question: what's the value of "value".
So, he don't specific what's the rest of the program... He said only the things that I wrote when I started this post...
He didn't write more about the question...

You're allowed to tell your teacher that s/he is an idiot, because the question, as you stated it, is unanswerable - the best you can say is "potentially vaguely random".

What do you think analogRead() does, given its name?

pinmode(A0,OUTPUT)
pinmode(A0,INPUT)
digitalwrite(A0,HIGH)
value=analogread(A0)-----> what's the value of this?

. . . is a slightly more tractable question (assuming all the corrections noted above)