Wire.write Problem. Arduino nano not sending data


hello,

i trying send i2c signals slave using arduino nano master. have read lot wire library , have made different attempts @ making work. however, after using oscilloscope see signals coming out saw arduino sending address of slave , nothing else. slave sending ack because pulling last bit down.
i tried changing way rewrite wire.write statement still cannot see arduino sending signals

please help

below 2 attempts @ making work. commented out first 1 have tried both independently , still did not see data being sent.

thank you

code: [select]

#include <wire.h>

void setup() {

 wire.begin();

 
}

void loop() {
int i;
 unsigned long data1[5] ={0x01, 0x22, 0x14, 0x25, 0xed};
 unsigned long data2[2] ={0x09, 0x0b};

/*wire.begintransmission(0b1100000);
for(i = 1; < 6; i++)
{
 wire.write(byte(data1[i]));
 if(i=5)
 {wire.endtransmission();
 delay(1);
 }   
*/

wire.begintransmission(byte(0x60));
wire.write(byte(0x09));
wire.write(byte(0x0b));
wire.endtransmission();
}

i'm struggling tried.

have verified (i2c scan) address (0x60)?

here store byte sized data in array of 32bits.
code: [select]
unsigned long data2[2] ={0x09, 0x0b};

you go , cast each 1 byte:
code: [select]
wire.write(byte(data1[i]));

you need slow down bit, , check transmissions there.  also, check see fi confirmed byte sent:

code: [select]
void loop()
{
  wire.begintransmission(byte(0x60));
  serial.println(wire.write(byte(0x09)));
  serial.println(wire.write(byte(0x0b)));
  wire.endtransmission();
  serial.println();
  delay(1000);
}


add
code: [select]
serial.begin(9600)
 to setup....


Arduino Forum > Using Arduino > Programming Questions > Wire.write Problem. Arduino nano not sending data


arduino

Comments

Popular posts from this blog

Help with codes to add 1 more shift register and add more to matrix LED

tcp client

Is there an HTML component in Flex 2.0?