-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
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
Rise error when I2C is not prepared #9
Comments
Hmm now I see that there is no room for new error :/ |
"maintained" is a bit of a stretch... I haven't looked in to this in a loong while but will of course merge any sane looking requests when I get around to eyeballing them. Anyway, it would require a breaking change to switch the return values to int16_t and use negative numbers for errors like this. Backwards compatible option would be to find a value in the reserved range that is not actually used by any of the supported MCU:s and use that for this purpose. edit: and with some ifdefs we can even work around the problem that in the future (or even now) there might come a MCU that uses said code (but probably not another). |
I also thought about switching error to int16, but it's not 100% ideal for backward compatibility. |
Is this library compatible with the ATmega2560 chip? |
off-topic for this issue, but maybe for the first TWI peripheral, the I2C::pullup method at least does not have a case for 2560. Just try it if it works it works, if not then you can add the support and make a PR, shouldn't be too hard. |
Sorry about the off-topic post. I'm a bit of a noob in GitHub! |
Hello.
I spend a lot of time now finding why I don't get any data from my sensor (BMP180) and then I found that I forgot to call init function with I2c.begin(). :D
Anyway it took me so long because all write and read functions returned 0 like OK.
Wouldnt be better to make, that if I2C is not initialized, the functions will end automatically with error?
P.S. nice to see that this library is still maintained. It's in my opinion much better then Wire library for Atmega, where I had some weird lock-ups and also work with this is much easier and clear in the code.
The text was updated successfully, but these errors were encountered: