Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: YKNCT_I2C.cpp
- Revision:
- 6:329e7b9d8cfc
- Parent:
- 5:29d8a2619c4f
- Child:
- 7:5b22492a5a13
--- a/YKNCT_I2C.cpp Thu Apr 04 10:16:19 2019 +0000 +++ b/YKNCT_I2C.cpp Sat Apr 06 01:48:55 2019 +0000 @@ -38,11 +38,11 @@ double Y_I2C::Enc(int address) { static char data[4]= {0}; - static double enc_data=0; + long long enc_data=0; i2c.read(address<<1, data, 4, false); - enc_data=data[3]<<24|data[2]<<16|data[1]<<8|data[0];; + enc_data=data[3]<<24|data[2]<<16|data[1]<<8|data[0]; wait_us(1000); return enc_data;