Author Topic: Analog -> Digital pin outs? Same as Mega?  (Read 1496 times)

gregcope

  • Full Member
  • ***
  • Posts: 174
  • Country: gb
Analog -> Digital pin outs? Same as Mega?
« on: November 01, 2019, 12:41:24 PM »
Hi,

I need a few more digital pins!

Does the M0 follow the Mega pin out map for example

A0 -> D24
A3 -> D27
A4 -> D28

etc..?

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Analog -> Digital pin outs? Same as Mega?
« Reply #1 on: November 01, 2019, 01:01:34 PM »
If you look in variants.h in the moteino samd\_version_\variants\moteino_zero you will find the following mapping:

/*
 * Analog pins
 */
#define PIN_A0               (14ul)
#define PIN_A1               (15ul)
#define PIN_A2               (16ul)
#define PIN_A3               (17ul)
#define PIN_A4               (18ul)
#define PIN_A5               (19ul)
#define PIN_DAC0             (14ul)

Where the numbers are actual digital pin numbers. So 14ul is D14 or A0.

gregcope

  • Full Member
  • ***
  • Posts: 174
  • Country: gb
Re: Analog -> Digital pin outs? Same as Mega?
« Reply #2 on: November 01, 2019, 01:15:09 PM »
Thanks!