After solving the problem of programming Arduino chips with my one and only Arduino board by your helps, I decided to connect them via I2C.
I used this:
which I picked up from playground.
Kept is simple and just as diagrammed on the tutorial there, but id does not work!
Arduinos are being programed right (tested), all connections 4 times checked, but what could be the reason? how to debug?
please help!
Edit: just to make sure, Analogue 4 of both connected, Analogue 5 of both connected, and both of these connections are connected to +5 via 1.5k resistors each.
Thank you, well I didn't do anything other than what the tutorial instructed and the code also. I didn't copy/pasted the code here to save space (they are on that link). I needed I'll do.
The test:
A master slave configuration. One Arduino - the master - changes a variable from 0 to 10 incrementally, and sends its through i2c to the other. The slave one test if it is 0, and blinks one LED or the other. In the slave program in the setup() the same var (being read) is set to zero. In my test it is always kept on zero (the related LED) blinking. Seems the connection is not active, but I didn't do anything other that what is stated in the tutorial (from playground).
Here's a very simple example I threw together. The slave simply returns 1 character at a time. The master fetches it and prints it to the serial port. http://www.eng.uah.edu/~jdw/avr/i2c_master.pde
Thank you, I programmed Arduinos with given new tutorial, and again no results. I only receive the messages: "master sleeping...go" that shows that Arduino is working and then nothing, as in the pic bellow. All connections checked.
Same configuration with both analogue 4s connected and go to +5 by a (now) 4.6k resistor, the same setup for analogue 5s, grounds joined, and nothing else in the configuration.
You didn't state explicitly what type of Arduino(s) you are trying to wire together. If one or both is a Mega board the I2C pins numbers used are different then the standard 168/328 boards. Just a shot in the dark.
Novice give some data please! we can't read your mind, and I can't see your hardware from here.
Yes, it matters very much how long the wires are. I2C is designed for Inter-Integrated Circuit communications - i.e., communicating between chips on a typical PCB. It is not, for example, meant to communicate between 2 boards with 100m of cable between them.
Jason the wires are 30cm, and my hardware is ordinary Atmega168 and Atmega328 with Arduino bootloader tested, and connected simply this way:
The 168 chip is powered by the Arduino standard board. The 328 one by the 5v regulator of SparkFun (also tested). I'm confused because everything is tested and all implementation is standard, nothing mine, and still does not work!
I programmed both with the code you kindly gave, had no errors and successfully downloaded to the chips.
I tested all connections with multimeter, no error found.
If a photo needed I can send it only by tomorrow, but till tomorrow headache may kill me (I can't sleep with having errors on Arduinos!)
Jason, I used a 10cm wire, and brought everything into one breadboard to keep a.s.a.p.
Didn't work either.
I don't bother the forum further I think the problem must be something trivial like lots of novice issues. I'll get a TC74 temp. sensor which is I2C based, and implement this tutorial separately with each Arduino I have. This differentiates the procedure and may help to clear the problem: http://naneau.nl/2009/01/18/arduino-and-an-i2c-temperature-sensor/