We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to achieve I2C Read by using Wire library Wire.endTransmission(false) always return 4 this code is OK with MEGA 2560 Board
I check this website: https://www.arduino.cc/en/Reference/WireEndTransmission 0:success 1:data too long to fit in transmit buffer 2:received NACK on transmit of address 3:received NACK on transmit of data 4:other error
7697 does not support wire library?
#include <Wire.h>
void setup() { Wire.begin(); Wire.setClock(50000L); Serial.begin(9600); }
uint8_t address = 0x0A; uint8_t reg = 0x01; uint8_t numBtyes = 2; uint8_t R_code = 0; uint8_t Buffer[64];
void loop() { int i = 0; Wire.beginTransmission(address); Wire.write(reg); Serial.print(Wire.endTransmission(false)); delay(1); Wire.requestFrom(address, numBtyes ); while(Wire.available()) { Wire.read(); i++; }
delay(1000);
}
Thanks
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I want to achieve I2C Read by using Wire library
Wire.endTransmission(false) always return 4
this code is OK with MEGA 2560 Board
I check this website: https://www.arduino.cc/en/Reference/WireEndTransmission
0:success
1:data too long to fit in transmit buffer
2:received NACK on transmit of address
3:received NACK on transmit of data
4:other error
7697 does not support wire library?
#include <Wire.h>
void setup()
{
Wire.begin();
Wire.setClock(50000L);
Serial.begin(9600);
}
uint8_t address = 0x0A;
uint8_t reg = 0x01;
uint8_t numBtyes = 2;
uint8_t R_code = 0;
uint8_t Buffer[64];
void loop()
{
int i = 0;
Wire.beginTransmission(address);
Wire.write(reg);
Serial.print(Wire.endTransmission(false));
delay(1);
Wire.requestFrom(address, numBtyes );
while(Wire.available())
{
Wire.read();
i++;
}
}
Environment
Thanks
The text was updated successfully, but these errors were encountered: