wiken
New Member
Posts: 45
|
Post by wiken on Oct 19, 2017 10:16:08 GMT
Hi. I have a problem using analogWrite and digitalWrite in the same sw. I see that both D2 and A2 is defined as 2.
One digital pin is declared as: const int sh_reg_serin = 2;//D2 to pin 14 of shift register serial in
And another analog pin is declared as: const int LedPin[12] = {26, 25, 24, 23, 22, 5, A0, A1, A2, A3, DAC0, DAC1};//Led pins free for indication.
When I remove code for LED ctrl, the shiftregister works fine. This is my LED ctrl line: analogWrite(LedPin[sw], (255 * RFSwitch[sw])); RFSwitch[sw] is 1 or 0.
Is there something I have missed?
Best Regards \Wiken 
|
|
|
Post by Admin on Nov 10, 2017 13:05:30 GMT
Unfortunately the ShieldBuddy does not allow the analog pins A0-A11 to be used as general purpose IO, like on the Arduino MEGA.
However will change this in a future hardware revision!
|
|
wiken
New Member
Posts: 45
|
Post by wiken on Nov 13, 2017 8:21:56 GMT
In this case we can use A0 to A11 as analog pins and control the LEDs brightness.
|
|