I2C WIRE LIBRARY No output on analog pin 4, 5. Troubleshooting proves code ok

Hello everyone, I am new to the Arduino community. I am happy to be part of the forums and would like some insight from a few members. I had a college project in communications. The project had two parts, SLAVE, and MASTER. My slave program worked flawless but the master program using the I2C protocol will not communicate with the other slaves on the I2C bus. I tried scoping analog pins 4 and 5 but got no output. I also troubleshooted the logic and conditional statements using the serial monitor and all seemed to be working towards design. It’s just the Arduino UNO refuses to send data on the I2C bus as it seems like using this code. I did a bunch of research but so far everything looks right; I am not sure what I missed. I think this thread would be a great help to the community as the wire reference is dry.

Below I have included my complete code and a public document from the professors requirements for the Master I2C device.

device requirements for Master Device using I2, look at _scenario 2_C:
https://docs.google.com/file/d/0B2Tm8x2TTxguckhtbGd6eExINlk/edit?usp=sharing

// **************Haralabos P. Nikolopoulos*****************
//*  Master Sender  Final Project assignment,  ENGN2030   *
//*  Wai Yung       SPRING 2013         Version 1.0       *
// ********************************************************


#include <Wire.h>
byte data_red;     //byte for red LED
byte data_green;   //byte for green LED
byte data_blue;    //byte for blue LED
byte onboardLED;   //Board Yellow LED
byte onboardLEDs;  //Board's current LED state
int i;             //loop variable used to determine slave address
//Manually entered all slave addresses in an array,*p starts at 0*
byte addy[10] = {0x11,0x12,0x13,0x14,0x15,
                 0x16,0x17,0x61,0x62,0x63};

void setup()
{
  Wire.begin(); // join i2c bus (address optional for master)
  i = 0;        // start sending instructions from address 0x11
  
  //initialize all LED Modes and Modules
  data_red    =  0x01;
  data_green  =  0x01;
  data_blue   =  0x01;
  onboardLED  =  13;
  onboardLEDs =  LOW;
  
  pinMode(onboardLED, OUTPUT);      // sets the digital pin as output
}


void loop()
{
  Wire.beginTransmission(addy[i]);   // transmit to device address (x)
  Wire.write(data_red);              // sends one byte to red LED
  Wire.write(data_green);            // sends one byte to green LED
  Wire.write(data_blue);             // sends one byte to blue LED
  
  //RED LED PULSE
  for(int z = 0; z < 20; z++){
    
    if(data_red == 0x01){
      data_red = 0x02;    
    }
    else{
      data_red = 0x01;    
    }
    
    Wire.write(data_red);
    Wire.write(data_green);
    Wire.write(data_blue);
    delay(500);
    
    //Start of internal LED state change
    if(onboardLEDs==LOW){
      onboardLEDs = HIGH;
      digitalWrite(onboardLED,HIGH);
    }
    else{
      onboardLEDs = LOW;
      digitalWrite(onboardLED,LOW); 
    }//end of onboardLED state change   
    
  }//end of red LED pulse
  
  
  //GREEN LED PULSE
  for(int z = 0; z < 20; z++){
    
    if(data_green == 0x01){
      data_green = 0x02;    
    }
    else{
      data_green = 0x01;    
    }  
      
    Wire.write(data_red);
    Wire.write(data_green);
    Wire.write(data_blue);
    delay(500);
    
    //Start of internal LED state change
    if(onboardLEDs==LOW){
      onboardLEDs = HIGH;
      digitalWrite(onboardLED,HIGH);
    }
    else{
      onboardLEDs = LOW;
      digitalWrite(onboardLED,LOW); 
    }//end of onboardLED state change 
    
  }//end of green LED pulse
  
  
  //BLUE LED PULSE
  for(int z = 0; z < 20; z++){
    
    if(data_red==0x01){
      data_red = 0x02;    
    }
    else{
      data_red = 0x01;    
    }
    
    Wire.write(data_red);
    Wire.write(data_green);
    Wire.write(data_blue);
    delay(500);
    
    //Start of internal LED state change
    if(onboardLEDs==LOW){
      onboardLEDs = HIGH;
      digitalWrite(onboardLED,HIGH);
    }
    else{
      onboardLEDs = LOW;
      digitalWrite(onboardLED,LOW); 
    }//end of onboardLED state change 
    
  }//end of blue LED pulse
  
  Wire.endTransmission(); // stop transmitting
  
  i++; //increment array pointer
  
  //reset counter after last address
  if( i == 10){
    i = 0;
  } 
  
}//end of void loop

Do you have 4.7K pullup resistors on SCL, SDA?

Yeap all slaves had pull up resistors on those lines.

No, not all slaves. Just 1 pull up resistor on each line total. One, single, lone, 4.7K resistor, located at the farthest device from the microcontroller. Too many resistors and the parts won't be able to pull the line low.

sorry to mislead... yea there was only one pullup resistor for all the slaves. I have a feeling that my code has an error somewhere.

You have a delay(500) in each section. That means when you look at the signals on a scope most of the time there will be nothing and you will only get a small burst of activity every half second. Unless you set the scope triggers correctly and it is a digital storage scope you will see nothing.

However do not try and run a stupidly large piece of code and expect it to work. Build it up simply, one address and one data transfer at a time.

I am using a DSO, and I am aware of that. If you look at my first post again and look into the document publicly posted on Google Drive you'll see the requirements. Hand coding all actions would be possible but impractical. As the title states I already broke it into smaller pieces which the logic seems to be ok. (troubleshooting). The address and conditional logic part all work flawless. My only issue is that it won't control the slaves in this experiment. This is not a large piece of code at all.

Any chance you have a dud uC? Try swapping the master & slave boards, see if the new master is able to control the lines.

I will try that. In the meanwhile can everyone have a look and tell if you spot anything within the code, thanks!

Hand coding all actions would be possible but impractical.

You are failing to understand what I said.
That code contains a lot of crap. That is a technical word for unneeded code. (unneeded at the moment)

If you are going to learn anything from this project you need to isolate the bit that is not working and write a sketch to do that bit. This is NOT what you have done before. Write something that just sends data to one device at one address over the I2C lines.
There is too much code to see what is going on. No professional programmer would ever get that much untested code working.

Grumpy_Mike, you are not understanding. All that has been already done.