6

What I'm doing wrong or why is it not working:

#define Uin A0;

void setup() {
}

void loop() {
  analogRead(Uin);
}

Results in a Error (expected ')' before ; token.

I thought #define just exists as a place holder.

TimK
  • 163
  • 4

1 Answers1

17

Because you have a ; at the end of your #define.

#define Uin A0;
analogRead(Uin);

becomes:

analogRead(A0;);

The Arduino website mentions this in their reference. For more in-depth detail about the C pre-processor you can read the (rather large) manual here.

Majenko
  • 105,095
  • 5
  • 79
  • 137
  • That's it. Thank you.

    Could you please link to the reference. (It is also answered there - I'm sorry) [In 5 min I can accept the answer]

    link

    – TimK May 15 '17 at 12:38