Finding Pin Names on MKR1000

I’m getting frustrated trying to find out the names of my pins in the IDE.

I tried looking at the diagram in the board documentation, but none of the names for the D port are recognised when I #define myname pin name

I tried using the names as on the silk screen (on the non visible side of the board as plugged into the card its on, ofc :slight_smile: ) but these arent recognised either

error messages like this

In function ‘void setup()’:
ex43_ard_glowball:82:16: error: ‘GPIO3’ was not declared in this scope
#define FanLow GPIO3

The board I’m struggling with is the MKR1000.

I tried looking in the variants folder for the pins_arduino.h but there is no MKR boards listed there. So now I’m stuck - how am I meant to know what to call the pins?

Thanks for advice,

Kevin.

Do the names on the silkscreen have numbers? I’d try using the numbers.

You can find the pin definitions in:
hardware/samd/1.8.11/variants/mkr1000/pins_arduino.h
which contains nothing but an include for:
hardware/samd/1.8.11/variants/mkr1000/variant.h
which starts with an include for:
hardware/samd/1.8.11/cores/arduino/WVariant.h

Did you install the board in the IDE?

RV mineirin

Yes the board is installed and compiles and runs etc. So IDE knows about the board.

However the folder hardware/samd doesnt exist, which is rather odd?

The silk screen isnt very helpful - for instance D2 is just labelled 2 , which isnt pin 2 I think. No other pin numbers…

A2 seems to work OK, but 3, D3, GPIO3 - none of these work. ‘3’ just results in nothing happening on the wanted pin, and the others are all unknown aliases.

In my PC the folder is locate in:

C:\Users\xxxxx\AppData\Local\Arduino15\packages…

RV mineirin

I think the pins labeled 0 through 14 on the silkscreen are Arduino pins 0 through 14, just like the pins labeled 0 through 13 on the Arduino UNO silkscreen are Arduino pins 0 through 13. I don’t know why some Arduino-compatible devices (are they all third-party devices?) use the names D0, D1, D2…

How are you testing that pinMode(3, OUTPUT); digitalWrite(3, HIGH); and digitalWrite(3,LOW); are not ‘working’ on the pin labeled 3 of your MKR1000?

thanks RV that’s where they are on mine too - why on earth they are’nt all in the same place…

the names Dx are all on the official Arduino pin out chart, just to confuse everyone.

pins 3,4,5 are all connected to LEDs (pin ->res->anode;cathode->gnd) via a 240R resistor for testing, but I’ve lifted the wire and tested with a DMM and they are floating, so inputs. There is a test write as follows

in the #define at the top:

#define FanLow 3

in setup():

pinMode(FanLow, OUTPUT);
digitalWrite(FanLow, HIGH);

no doubt I missed something crucial :slight_smile: Its been a couple of years since I last did Arduino stuff…

Other than physical damage, I can’t think what might be causing your MKR1000 to not have software control of Pin 3. Have you tried the other pins? Are you sure the LED is the right way around? Sorry, but I think that grasping at straws is all I have left. :frowning:

Thanks John and RV for your assistance.

I moved the pin mode and write code into the main loop, an voila it worked. So the pin mode must get overwritten somewhere in the setup code - this is the trouble when hacking the example code without reading through it all. My bad !

So I’m home and at least vigorously towelling myself off , if not dry :slight_smile:

The main thing is that I understand that the silk screen is definitive and to ignore the diagrams etc. And I found where the pin name list is stored, so thanks to you both for those two things.

Kevin.

1 Like