Arduino Lilypad USB plus pins

Hello, I'm new using Lilypad , and i can't define its pins.

I have tried "const int pin= A2" and "#define pin A2" but when I analog read I can't get the value of A2 pin...

Then, checking the schematic and doing some test I done "const int pin= PF6" and it works, I get the A2 pin value.

I don't understand, can anyone expain it? Why it is different from for example Arduino Uno?

Please post your full sketch. If possible, you should always post code directly in the forum thread as text using code tags (</> button on the toolbar). This will make it easy for anyone to look at it, which will increase the likelihood of you getting help. If the sketch is longer than the forum will allow then it's OK to add it as an attachment. After clicking the "Reply" button, you will see an "Attachments and other settings" link.

Please always do an Auto Format (Tools > Auto Format in the Arduino IDE or Ctrl + B in the Arduino Web Editor) on your code before posting it. This will make it easier for you to spot bugs and make it easier for us to read.

const int xpin = PF1;                  // A9
const int ypin = PF6;                  // A2
const int zpin = PF7;                  // A7



double vref = 3.30;
int steps = 1023;
double sesnibility = 0.3;

void setup() {
  
  pinMode(xpin, INPUT);
  pinMode(ypin, INPUT);
  pinMode(zpin, INPUT);

  Serial.begin(9600);

}

void loop() {


  double rx = analogRead(xpin);
  delay(1);
  double ry = analogRead(ypin);  //Lectura de los puertos.
  delay(1);
  double rz = analogRead(zpin);


  double converter = steps * sesnibility / vref; 

  double GX = (rx - 509.00) / converter;
  double GY = (ry - 512.00) / converter;
  double GZ = (rz - 527.00) / converter;



  Serial.print(GX);
  Serial.print(" ");
  Serial.print(GY);
  Serial.print(" ");
  Serial.println(GZ);

  delay(100);


}

The value of PF1 is 1.
The value PF6 is 6.
The value of PF7 is 7.

These are just macros that define the bit of each pin. The port/bit notation can not be used with the standard Arduino I/O functions like pinMode, digitalWrite, digitalRead, analogRead, analogWrite. If you find they do work, that is purely by chance. These macros are intended to be used for direct port manipulation, not using the Arduino API.

The only explanation I can give for PF6 causing analogRead on pin A2 to work is if there is an error in the circuit of your Lilypad USB and the the wrong pin from the microcontroller is marked A2 on the silkscreen.

When troubleshooting, it's always a good idea to remove as much unnecessary complexity from your program as possible. Here is a good test sketch:

byte readPin = PF6;

void setup() {
  Serial.begin(9600);
}

void loop() {
  Serial.println(analogRead(readPin));
  delay(500);
}

Which board is selected in the IDE?
Have you installed the SparkFun boards package? (instructions)

Thank you both for awnsering

oqibidipo:
Which board is selected in the IDE?
Have you installed the SparkFun boards package? (instructions)

Ohh! No...

I'll try now

It was that, I was selecting "Arduino Lilypad USB" but i had to add "Arduino Lilypad USB Plus" adding Sparkfun AVR

Thanks!!