Problem with analog pins' name when trying to connect Arduino board and Processi

I am trying to use Processing with Arduino Uno board to read the change of voltage done by a potentiometer. The code is simple:

    import processing.serial.*;
    import cc.arduino.*;
    
    Serial myport;
    Arduino arduino;
    
    color off = color(4, 79, 111);
    color on = color(84, 145, 158);
    int val=0;
    float value=0;
    void setup() {
      size(600, 600);
      println(Arduino.list());
      arduino = new Arduino(this, Arduino.list()[0], 57600);
      arduino.pinMode(0, Arduino.INPUT);
    }
    
    void draw() {
      stroke(on);
      val = arduino.analogRead(0);
      println(value);
      ellipse(300,300,value,value);
      delay(100);
    }

My question is: For analog pins in Arduino IDE one should type A0, A1, ... but here in Processing IDE it is an error to type so. Is it possible that Processing reads the wrong pin? Because in Serial output I always get zero, however, for the same circuit in Arduino IDE the values change as I turn the potentiometer knob. I also tried different Serial ports. Thanks

For analog pins in Arduino IDE one should type A0, A1, ...

Or 0, 1 etc. The Arduino analogRead() function then uses the analogue pins rather than the digital pins.

UKHeliBob:
Or 0, 1 etc. The Arduino analogRead() function then uses the analogue pins rather than the digital pins.

Then any idea why println() does not show anything other than zero?

Do you have the standardFirmata code loaded on the Arduino? Do you have any other test programs to check that it is plugged in properly?

Then any idea why println() does not show anything other than zero?

I don’t see any code with Serial.println() in it.

      arduino.pinMode(0, Arduino.INPUT);

You really do NOT want to be f**king with the HardwareSerial instance's pins. They are how Processing and the Arduino communicate.

For analog pins in Arduino IDE one should type A0, A1, ...

Incorrect. A0, A1, etc. are the names of the digital pins that share space with the analog pins numbered 0, 1, etc.

but here in Processing IDE it is an error to type so

Correct. Processing knows nothing about the Arduino team's efforts to standardize pin names for different boards. YOU must know the pin numbers.

Is it possible that Processing reads the wrong pin?

No.

      val = arduino.analogRead(0);
      println(value);

Read a value. Store it in val. Print something else. Wonder why what is printed in not what was read. Well, I know why.