bvernham Posted January 1, 2016 Report Share Posted January 1, 2016 I am trying to implement the MPU6050 on the NavSpark Platform. The I2C is slightly different which is no big deal to handle. The big issue is PROGMEM can not be used. It is suggested to use something this this "const double tmp[10000] =" Any suggestions on how to implement MPU6050 within this library structure for the NavSpark Platform? Thanks Bruce Quote Link to comment Share on other sites More sharing options...
bvernham Posted January 3, 2016 Author Report Share Posted January 3, 2016 I noticed in the code that using PROGMEM is "optional" in MPU6050.CPP? if (useProgMem) progBuffer = (uint8_t *)malloc(MPU6050_DMP_MEMORY_CHUNK_SIZE); for (i = 0; i < dataSize;) { // determine correct chunk size according to bank position and data size chunkSize = MPU6050_DMP_MEMORY_CHUNK_SIZE; // make sure we don't go past the data size if (i + chunkSize > dataSize) chunkSize = dataSize - i; // make sure this chunk doesn't go past the bank boundary (256 bytes) if (chunkSize > 256 - address) chunkSize = 256 - address; if (useProgMem) { // write the chunk of data as specified for (j = 0; j < chunkSize; j++) progBuffer[j] = pgm_read_byte(data + i + j); } else { // write the chunk of data as specified progBuffer = (uint8_t *)data + i; } But the code always uses "true" so PROGMEM is always used. bool MPU6050::writeProgMemoryBlock(const uint8_t *data, uint16_t dataSize, uint8_t bank, uint8_t address, bool verify) { return writeMemoryBlock(data, dataSize, bank, address, verify, false); } Can the "true" just be changed to "false"? Thanks Bruce Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.