declaring analog and digital inputs in lilypad

Hi everyone,

I hope anyone can help me with my problem. I am building a device for my graduation project using lilypad arduino. It is the first time I use it and I am getting quite confused with something. I need to use most of the pins (digital and analog)of this microprocessor. However, when declaring, I am not sure how to make a difference between the digital and the analog pins. Let’s say I want to use digital pin 1 and analog pin 1. How would you declare this?

I really appreciate your answers.

Kind regards

const int analoguePin = 1;
const int digitalPin = 1;

(though don't forget digital pin 1 is part of the serial interface)

Hi,

Thanx, I'm going to try now. The thing is that I am using all analogue pins from 0 to 5 and almost all digital pins. If I write const int analoguePin1 = 1; const int analoguePin2 = 2; etc.

will it also recognize all analogues?

const int analoguePin1 = 1;
const int analoguePin2 = 2;
etc.

will it also recognize all analogues?

Well, the compiler doesn’t recognize etc. as a valid keyword. :wink:
But, if you actually have 6 const int declarations, then yes. Don’t forget that the poins are numbered starting at 0, not 1.

Don't forget, digital pin 0 and 1, and analogue pin a5 are under the irritatingly spiky 6-pin connector that sticks out and catches and rips on other clothing. If you're using crocodile clips to prototype (which is pretty much the best way of prototyping Lilypad projects before you sew it all together) then you can't actually feasibly leave those pins connected while you try and force the FTDI breakout board onto the 6 pin connector. I hate that connector.