Missing Operands

I don't know why this is not working but it said missing operands. Please help.

int potUp = A0;
int potForward = A1;
int potSide = A2;
int potGForward = A3;
int potGSide =A4;

void setup() {
  // put your setup code here, to run once:

pinMode(potUp, INPUT);
pinMode(potForward, INPUT);
pinMode(potSide, INPUT);
pinMode(potGForward, INPUT);
pinMode(potGSide, INPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
int valUp = map (analogRead(potUp), 0, 1023, 0, 9);
int valForward = map (analogRead(potForward), 0, 1023, 0, 9);
int valSide = map (analogRead(potSide), 0, 1023, 0, 9);
int valGForward = map (analogRead(potGForward), 0, 1023, 0, 9);
int valGSide = map (analogRead(potGSide), 0, 1023, 0, 9);

Serial.println() = "$";
Serial.print() = valUp;
Serial.print() = valForward;
Serial.print() = valSide;
Serial.print() = valGForward;
Serial.print() = valGSide;


}

Post the full error message. In code tags please.

Serial.println() = "$";

Have you ever seen code like that in any of the examples?

(Hint: the answer is " no")

Read up how functions (in general) work and how the serial.print familiy works (Serial - Arduino Reference).

  Serial.println() = "$";

The serial.print family requires one (or more) argument(s); you also can't assign a value to a function.

Try

Serial.println("$");

The serial.print family requires one (or more) argument(s);

Not quite true. Serial.println(), which is what the OP is using, does not need any arguments but Serial.print() does.

Yeah, what he has shouldn't give "not enough operands", it should give "left operand must be an lvalue" or similar.

UKHeliBob:
Not quite true. Serial.println(), which is what the OP is using, does not need any arguments but Serial.print() does.

Your right.

Thank You for all of your non-paid support. You are so supportive. :slight_smile:

Serial.println() = "$" //Correct! It's not working.

Serial.println("$") //This works! Thank You! I solved it now!