WT1-IMU Serial Dual Axis Attitude Inclination Sensor
Module Source
Specifications
Hardware Connection
Connect the module's VCC to 5V on the development board.
Connect the TX of the module to pin 10 of the board.
Connect the module's RX to pin 11 of the board.
Connect the GND of the module to the GND of the development board.
Usage Method
Place the following files in the same directory as the .ino file.
File Download
📌 Download Center (click the link)
📌 In Download Center -> Module Porting Manual Download [Not Porting Code], find the chapter's compressed file.
Enter the code:
c
/******************************************************************************
* Test Hardware: LCSC ColorEasyDuino Development Board
* Version Number: V1.0
* Modified By: www.lckfb.com
* Modification Date: April 19, 2024
* Function Overview:
*****************************************************************************
* Open-source development board hardware and software information and related projects hardware and software information on official website
* Development board official website: www.lckfb.com
* Technical support resident forum, any technical problems are welcome at any time to exchange learning
* LCSC Forum: club.szlcsc.com
* Follow our Bilibili account: [立创开发板], stay toned to our latest news!
* We focus on cultivating Chinese engineers rather than profiting from board sales.
******************************************************************************/
#include "JY901.h"
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // 开发板的模拟串口RX, 开发板的模拟串口TX
/*
Test on Uno R3.
JY901 UnoR3
TX <---> 0(Rx)
*/
void setup()
{
Serial.begin(115200);
mySerial.begin(115200);
}
void loop()
{
serialEvent();
Serial.print("Acc:");Serial.print((float)JY901.stcAcc.a[]/32768*16);Serial.print(" ");Serial.print((float)JY901.stcAcc.a[]/32768*16);Serial.print(" ");Serial.println((float)JY901.stcAcc.a[]/32768*16);
Serial.print("Gyro:");Serial.print((float)JY901.stcGyro.w[]/32768*2000);Serial.print(" ");Serial.print((float)JY901.stcGyro.w[]/32768*2000);Serial.print(" ");Serial.println((float)JY901.stcGyro.w[]/32768*2000);
Serial.print("Angle:");Serial.print((float)JY901.stcAngle.Angle[]/32768*180);Serial.print(" ");Serial.print((float)JY901.stcAngle.Angle[]/32768*180);Serial.print(" ");Serial.println((float)JY901.stcAngle.Angle[]/32768*180);
Serial.print("DStatus:");Serial.print(JY901.stcDStatus.sDStatus[]);Serial.print(" ");Serial.print(JY901.stcDStatus.sDStatus[]);Serial.print(" ");Serial.print(JY901.stcDStatus.sDStatus[]);Serial.print(" ");Serial.println(JY901.stcDStatus.sDStatus[]);
Serial.println("");
delay(100);
}
void serialEvent()
{
while (mySerial.available())
{
JY901.CopeSerialData(mySerial.read());
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53