- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Could someone glance over my attached project. It is of I2C master taking data from BME280 environmental sensor and then transmitting the data out over BLE. I would like to view this data in Cysmart but I am unable to do so. Could someone have a look over my project please.
Regards
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In your i2c.h are two warnings which show up errors.
In BME_WriteReg() you have the line
I2C_1_I2CMasterWriteBuf(BME_ADDR,(uint8 *)Write_Buf,2,I2C_1_I2C_MODE_COMPLETE_XFER);
Take the term (uint8 *)Write_Buf
Write_Buf is an array of 32bit integers and your statement will transfer the first two bytes of the array. That does not match at all.
Same applies for the warning-flagged lines.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In your i2c.h are two warnings which show up errors.
In BME_WriteReg() you have the line
I2C_1_I2CMasterWriteBuf(BME_ADDR,(uint8 *)Write_Buf,2,I2C_1_I2C_MODE_COMPLETE_XFER);
Take the term (uint8 *)Write_Buf
Write_Buf is an array of 32bit integers and your statement will transfer the first two bytes of the array. That does not match at all.
Same applies for the warning-flagged lines.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bob
Thanks for coming back to me, I think i know what you are getting at, basically I am mixing my data types? going from 32 bit unsigned to 8 bit? Unfortunately programming is not my strongest asset but i am learning
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, uint8 would be better.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Cheers Bob
much appreciated.
Regards
paddy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey buddy
Is it working now? I just want to look out this project.
If it is done, please share the same at suranibharat4@gmail.com, it would be such a kind of you for me.
Regards,
BS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Go through the rest of your program, the returned value must not be a uint32 but an uint8. Same for main(). You ought to transmit the combined high and low pressure value as
uint16 Value;
Value = ((uint16)HighByte << 😎 | LowByte;
I miss a BLE_Start() API
Bob