How to set D8 to A8 by use Firmata.StandardFirmata with C#

userHead acer1204 2017-07-05 22:18:43 2351 Views0 Replies
In the Doc file, i found the pin3(D8-A8) has two mode.(digital or analog)

Image

My lattepanda arduino is use Firmata.StandardFirmata firmware.

Arduino m_Arduino = new Arduino();
m_Arduino.pinMode(8, Arduino.ANALOG);
m_Arduino.analogPinUpdated += M_Arduino_analogPinUpdated;
void M_Arduino_analogPinUpdated()
{
//do something
}
the pin8 not change to adc, it just is digital.

When i see the Firmata.StandardFirmata code, and found the Board.h file.
In Leonardo digital/analog pin config.
#define IS_PIN_DIGITAL(p) ((p) >= 0 && (p) < TOTAL_PINS)
#define IS_PIN_ANALOG(p) ((p) >= 18 && (p) < TOTAL_PINS)

Why the analog pin need to greater or equal to 18?

It does not seem to be associated with the doc picture?