Hello !
I bought a "Wave Shield" for my project, but the other components of that project forced me to solder the 5 pins that the shield use in 9, 10, A1, A2 and A3 instead of the default 2,3,4,5,10...
How do i change that ? I think i need to modify the library, but i don't know how to do that, can you help me ?
I think i need to modify the library
I don't.
but i don't know how to do that
Well, if you DID need to, you could use a text editor.
can you help me ?
You have some code you didn't post, trying to drive some hardware that you only vaguely described, with some unspecified pins connected to some pins on the Arduino, in some undefined order, that apparently doesn't do what you want. And, yet, you want us to help. Does that really seem reasonable?
Ok, not precise enough.
The shield i bought is this one :
And i didnt try any code for now, i just read the exemple there was in the library, but it is said in the guide that the pin 2,3,4,5,10 are the default one, and i don't know any function to bind the pins to the one i want.
Am i precise enough ?
There are pins on the shield that connect to pins on the Arduino. You solder jumper wires between the pins on the shield and pins on the Arduino.
The library talks to the pins on the shield, which you physically connected to pins on the Arduino.
The pins and ports that the library uses are defined in dac.h, which you can edit with a text editor.
Thanks !
Problem is, i don't find what part of the library i should edit
Is it in the "mcpDac.h" file ?
Jaeth:
Thanks !
Problem is, i don't find what part of the library i should edit
Is it in the "mcpDac.h" file ?
I don't know what library you are looking at. The device that you bought was manufactured by adafruit.com: Adafruit Wave Shield for Arduino Kit [v1.1] : ID 94 : $22.00 : Adafruit Industries, Unique & fun DIY electronics and kits
On their page, they link to a library which contains a file called dac.h. In that file, the important lines are:
#define DAC_CS_PORT PORTD
#define DAC_CS_DDR DDRD
#define DAC_CS PD2
#define DAC_CLK_PORT PORTD
#define DAC_CLK_DDR DDRD
#define DAC_CLK PD3
#define DAC_DI_PORT PORTD
#define DAC_DI_DDR DDRD
#define DAC_DI PD4
#define DAC_LATCH_PORT PORTD
#define DAC_LATCH_DDR DDRD
#define DAC_LATCH PD5
The _DDR statements define the direction (DDRD is read, so input). The pins are grouped in ports, so you'll need to consult the datasheet to determine which port the pin is in, and what its name in the port is (usually the letter matches the port name's letter, and the pins are numbered 0 to 7 within the port).
You can see, then, that PD2 is the third pin in port D, which corresponds to the pin to the left of the TX/RX pins, when the TX/RX pins are at the top. Port D is the first 8 pins, on the right. Other ports correspond to pins 8 through 13 and the analog pins being used as digital pins.
The Direct Port Manipulation page has more details.