I'm working on my first project and am having trouble uploading the sketch.
The project is built on an Arduino Uno but I am testing on a Mega 2560. Once working I will transfer to a nano.
Is their any difference in the connections?
Look at the pinouts (or schematics) for both Mega and Uno. The I2C pins are not on A4 and A5 on a Mega. On the header with the pins 8 to 13 are additional pins, two of them for the I2C interface. Those two signals are also available on pins 20 and 21.
S S S S
C D D C
L A A L
x x x x 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 2 2
3 2 1 0 9 8 7 6 5 4 3 2 1 0 4 5 6 7 8 9 0 1
I think that on older Unos, the signals were only available on A4 and A5. For compatibility reasons the ones on the most left header were added in later versions (R3?).
Although I have done my best to not make mistakes in above 'drawing', please double check.
Thanks you sterretje for all the information especially the comment
"The I2C pins are not on A4 and A5 on a Mega."
I will do as you have said and study the pinouts. I will have to change the A4 and A5
once I find them in the code.
I will have to change the A4 and A5 once I find them in the code.
If you find references to A4 or A5 they are not connected to I2C (on an UNO),
but probably a problem for the usage of I2C.
I am well pleased my first project is working.
Thanks to the tutorial on simple-circuit.com.
A bit of a learning curve but I have managed with the help of this forum to get the very basics going.
Thanks again sterretje
PS: Added pictures.
It looks a bit hairy but It works.