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: JY901.h
- Revision:
- 9:899168e14871
- Parent:
- 7:a06925c41956
--- a/JY901.h Fri Apr 23 09:00:33 2021 +0000 +++ b/JY901.h Tue Apr 12 00:39:26 2022 +0000 @@ -4,11 +4,17 @@ #include "SoftI2C.h" #include "mbed.h" -/*example************************************* +/* +JY901 + + +・使用例 +========================================== #include "mbed.h" -#include "JY901.h" +#include "JY901_OS6.h" I2C myi2c(p28, p27); +SoftI2C JY901 jy901(&myi2c); int main() @@ -18,10 +24,11 @@ while(1) { angle = jy901.getZaxisAngle(); - printf("%f\r\n", angle); + printf("%d\r\n", angle); } } -**********************************************/ +========================================== +*/ #define IICADDR 0xa0 // IIC address #define g 9.80665 // Acceleration of gravity @@ -147,6 +154,7 @@ /*************************************/ private: + char *getdata(char registar); float s16(int dataL, int dataH);