Oh, i didn’t know that. So what is the next step? Should i wait for the fix and start compiling it again? Or should i start downloading the firmware from the web-ide and upload to the core manually?
Problem is i’m afraid i don’t even have a working code sample, so i cannot say for sure this is related to i2c or code, etc…
If you have a working and available source-code for this, i could try with that, so at least i could see that this is i2c related for sure.
Thanks for your continuous help I’m not really a technical person, so not really sure how these things should be connected (especially with the pull-up resistor), i just connected the pins and that’s it.
Here is my sensor:
Not sure if i have to use any pull-up resistors and if yes where (and how).
Your test code would be brilliant! If you could that ,that would be awesome!!!
Thanks a bunch Kenneth for all your help again, really appreciate it.
I think the library is a little broken but from the repo link i pasted above, there’s an example that works like how you just tested without the library!
If i don’t fix it before the I2C issue is resolved, simply use that example as a temporary solution. I’ll ask @peekay123 for some help with the library errors.
Doesn’t look complicated to fix but i’ll probably tackle it few hours later.
Actually i just need whether the values are changing (somebody is moving the sensor), and i think this is more than enough for this purpose. I’m more than happy with this solution, so thanks again!
Hi @kennethlimcp, I seem to be able to get the no-library example working, however I need to take quicker readings and when I remove the delay at the end of the main loop the photon seems to lock up very quickly. Is this a known problem? Thanks
The recommended output datarate of the chip is 12.5-400Hz.
Although datasheet also shows a current-datareate diagram of up to 3200Hz, without delay I’d guess you might get a bit too fast.
If you are cloud-bound and single threaded you’ll have a 1ms delay between each interation of loop() limiting you to 1kHz already, so adding another delay(2); should bring you bellow 400Hz, but do you really need to be that quick - try not to go bellow 10ms delay?
I’m not too familiar with this chip, but others do feature an interrupt output to inform the controler when data is ready - this should give you the fastest possible speed, but usually requires more setup work in code and on the chip.