I do miss some fundamental information.
When looking up all the boards I have purchsed, I can not find uot wether to use the
MCU-pin number or the MCU pin aberrative name or the boards description pin name?
Which is correct?
Sorry confused.
Hi,
Welcome to the forum.
Please read the post at the start of any forum , entitled "How to use this Forum".
OR
http://forum.arduino.cc/index.php/topic,148850.0.html.
What boards do you have.
If they are Arduino boards, you use the pin names/numbers printed on the PCB, not the controller IC pin numbers.
Reference ALL your pin allocations to the PCB data.
So
pinMode(5, OUTPUT);
Would make pin 5 on the PCB an output.
Or to make your coding easier;
byte outsigPin = 5;
void setup
{
pinMode(outsigPin, OUTPUT);
}
Tom..
Google "arduino pin map" just to see what comes up. Replace "arduino" with the name of your board if you want the top choices to be about your board.
The following diagram belonging to Arduino UNO may be helpful.
It is an ItsyBitsy not found in Aduino.cc
Acording to image, the board via 7, is connected to MCU pin 1
Link:
Pinouts | Introducing Adafruit ItsyBitsy M4 | Adafruit Learning System
Here via7 is the same as #7 - GPIO #7 can PWM ???
So const byte interruptPin = 7; is correct?
But what about A0 etc
byte OUT_SIGNAL_A0 = a0;
pinMode(OUT_SIGNAL_A0, OUTPUT);
analogWrite(OUT_SIGNAL_A0, 50%); //pwm?
It is working now. Running on 3V battery only.
But it must be the Ardino compiler, who know's what board is connected? I guess
Br Cofused
How to post an image.
Here via7 is the same as #7 - GPIO #7 can PWM ???
So const byte interruptPin = 7; is correct?
Pin 7 is not a PWM pin.
Pin 7 is not an external interrupt pin.
byte OUT_SIGNAL_A0 = a0;
pinMode(OUT_SIGNAL_A0, OUTPUT);
analogWrite(OUT_SIGNAL_A0, 50%); //pwm?
A0 is not a PWM pin. It is a non PWM pin that can be set to be a digital input, digital output or analog input. 50% will cause an error.
PWM pins are 3,5,6,9,10,11 (analogWrite()).
groundFungus:
Pin 7 is not a PWM pin.
Pin 7 is not an external interrupt pin.
A0 is not a PWM pin. It is a non PWM pin that can be set to be a digital input, digital output or analog input. 50% will cause an error.PWM pins are 3,5,6,9,10,11 (analogWrite()).
I think you had better read this;
To quote one paragraph.
Nearly all pins can do PWM output
All pins can be interrupt inputs
Along the right edge
#0 / RX - GPIO #0, also receive (input) pin for Serial1. PWM output
#1 / TX - GPIO #1, also transmit (output) pin for Serial1. PWM output
SDA and SCL - these are the I2C hardware interface pins. There's no pull up on this pin by default so when using with I2C, you may need a 2.2K-10K pullup on each to 3.3V. PWM output
#5 - GPIO #5. This is a special OUTPUT-only pin that can PWM. It is level-shifted up to Vhi voltage, so its perfect for driving NeoPixels that want a ~5V logic level input. You can use this with our NeoPixel DMA control library to automatically write NeoPixel data without needing any processor time.
#7 - GPIO #7 can PWM
#9 - GPIO #9 can PWM
#10 - GPIO #10 can PWM
#11 - GPIO #11 can PWM
#12 - GPIO #12 can PWM
#13 - GPIO #13 can PWM, is connected to the red LED next to the Reset button
itsy is not a 328.
Tom...
itsy is not a 328.
My mistake. Did not look closely. Apologies.
...It could be (?)
This where you need to scratch under the hood a bit to reach a fairly advanced topic.
In most IDE / compiler environments there is a lot of ‘abstraction’ going on that allows pins, registers and other stuff to have friendly, memorable names. This includes the ability to call a ‘cow‘ a ‘pigeon’, or any other nonsense required to conform to one architecture in a different environment.
This how many newer boards are accommodated into the existing Arduino ecosystem. It’s not a small thing to grasp.
However this assumes that casual users won’t mingle (or even know about) those two worlds unless they know what they’re doing.
In Arduino IDE land, a lot of that magic happens in boards.txt, and platforms.txt - deep down in the Arduino hardware folder.
Don’t fiddle with those contents unless you save a backup copy and have a pretty good idea what you’re doing!
EDIT: as @pert points out below, I should have mentioned pins.h
Pin mapping for this board is done in the itsybitsy32u4 variant's pins_arduino.h:
Thank's replying, but what I do wnant, is some of the attached picture.
which ones is the best I do not know.
But adafruit_products_pro5.png show at least pin-number to be used in programming? I think.
I do not dare to ask ARDINO or ADAFRUIT to create such pictures on all board.
I really do not.
Br