How change default pin numbers in pins_Arduino.h library

Hi, everybody! Please, answer such a question. How can I change default pin numbers in pins_Arduino.h library? Configuration: 1. Hardware: - Arduino Uno with ATMEGA328P-PU - Multi-function Shield Expansion Board for Arduino (dx.com, aliexpress.com, ets.) 2. Software = arduino-1.0.5-r2

Questions: 1. I think, library "..\arduino-1.0.5-r2\hardware\arduino\variants\standard\pins_library.h" used. Is it right? 2. Multi-function Shield has the same 6-pin and 8-pin connectors as the Arduino, and has two 74HC595 for control of 4-digit 7-segment display. Pins of first 74HC595 has next connects: - Arduino Uno has pin D8 (latch pin (ST_CP)), which must connect to pin 12 of 74HC595. But Multi-function Shield has pin D4, which really connects to pin 12 of 74HC595. And other SPI pins too - D7 of shild connect with D11 of 74HC595, and D8 of shild connect with D14 of 74HC595. It can not be exchange. Because of I can not use SPI.h library, and I must change library pins_Arduino.h (only for this one Arduino). Which pins_Arduino.h library string I must change? Can I change pin numbers directly in program, not in library?

Thanks, Andrew

You only need to change your sketch, not the core files that map the software names to the physical ports/pins of the chip.

Your best option is to use the shiftOut( ) command: 74HC595-11 is the shift register clock - define that as clockPin 74HC595-12 is the output register clock - define that as latchPin 74HC595-14 is the serial data in line - define that as dataPin

byte clockPin = 7; byte dataPin = 8; byte latchPin = 4;

declare them as OUTPUTs in setup()

Then: digitalWrite (latchPin, LOW); shiftOut(dataPin, clockPin, MSBFIRST, dataToSend); digitalWrite (latchPin, HIGH);

Andrew_1944: Hi, everybody! Please, answer such a question. How can I change default pin numbers in pins_Arduino.h library?

You should not change the pin number mappings. That file simply relates hardware pins (such as "PORTB, bit 5" to "Pin 13"). It does not change any hardware on the board, and it will only make your programs not work.

If you need to "re-route" pins, you need a "go-between" shield. Check out this link:

(click the image for the link)

This board has solderable jumpers to map any pin to any pin. For example, if you need Arduino pin #8 to go to shield pin #4, just close the appropriate jumper.

The solderable jumpers can be "unsoldered" to change the configuration of the board if you make a mistake (or need it for a new project).

This is one of THE most useful boards I have for the Arduino!

CrossRoads: You only need to change your sketch ...

CrossRoads! Thank You very much for your advise. I shall try.

Andrew

Krupski: If you need to "re-route" pins, you need a "go-between" shield....

Krupski! Thank You very much for your advise. Indeed, I think, that shield is very usefull. I see it first.

Andrew