'A2' pin not working

I am trying to control a simple RGB strip via my spark. The circuit I am using works just fine with an Arduino UNO, but no matter what I try, I can not get A2 to do an analogWrite. Other analog pins work fine. I was able use analog ports A0, A1, A5, A6 and A7 to work they way that I want, but not A2. This really would not be much of an issue, except that I would like to use the shield shield and use a protoshield on top. Can anyone think what I might be doing wrong, or is there something wrong with my core?

It sounds like you are trying to use the PWM or "analog out" feature with pin A2, but it does not have a PWM timer and cannot do analog out. According to the doc:

...the user can send analog values to the pins using the function analogWrite().This feature is only available on the following pins: A0, A1, A4, A5, A6, A7, D0 and D1.

So you could try D0 and D1.

Hope this helps!

1 Like

Thanks, that helped, or at least point me in the right direction. I missed this page: http://docs.spark.io/#/shields/shield-shield-pin-mapping

1 Like