![]() ![]() Now, it seems that twi_writeTo() is the guilty party so if I go to "twi.c" indicate that we are done transmitting Int8_t ret = twi_writeTo(txAddress, txBuffer, txBufferLength, 1) So we know that something naughty is happening at: Now, the code hangs if I cut power to the compass after having printed: If you have an I2C device you want to test it with, put the relevant deviceId. Serial.print("Data received, value is: ") Serial.println("About to end transmission") Serial.println("About to begin transmission") Some more info, I chopped up the example sketch of the CMPS03 lib to make theįollowing sketch which runs without need for the lib. I 'm using the 0018 IDE on a kubuntu 64-bit Linux platform. I have managed to remove hanging by sticking "return" statements in various places such as twi_readFrom(), twi_writeTo() or TwoWire::endTransmission() for example, this removes the hanging by always returning 0 so it's useless but it points to these libs as being the hangers. I 'm fairly certain the guilty party is twi.c or perhaps Wire.cpp. Value = value + ((unsigned int) Wire.receive()) Unsigned int value = ((unsigned int) Wire.receive()) << 8 The CMPS03 lib is very simple, here is the read() function. The code hangs if I cut power to the compass and resumes when I restore it. Are you guys sure? I am using the CMPS03 library which adds the following sketch to examples: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |