Accessing Analogue In, Arduino
I’ve been using lilypad for some projects and I needed MORE pins! I was aware of them saying that you can use the Analogue pins for digital output, but I just wasn’t sure how. and turns out – it’s a lot easier than I thought. So writing this post incase someone else is stuck – all you need to do to use the pins is name them in the following convention when coding – so
Pin 14 = Analog in 0
Pin 15 = Analog in 1
Pin 16 = Analog in 2
Pin 17 = Analog in 3
Pin 18 = Analog in 4
Pin 19 = Analog in 5
These are typically marked A0 A1 A2 and so on. These are not PWM pins is the only thing to be aware of. There is a PWM library you can download, which does a software version. I haven’t needed to do this so I’m not sure how well it works. It’s described as “An Arduino and Wiring Library to produce PWM signals on any arbitrary pin.”
Sample would be
int led = 15; //the LED is on pin A1, which is 15
Easy Peasy.

