TroubleshootingArduino

Program for DFRobot SEN0386 accelerometer does not work with Arduino UNO

userHead Nikodem.Slezinski 2023-08-24 06:00:38 398 Views2 Replies

Hello. I have sensor DFRobot SEN0386. I connected RX to TX and TX to RX on Arduino UNO (1 and 0 ports), also 5v and gnd connected.

The program is:

#include <DFRobot_WT61PC.h>

DFRobot_WT61PC sensor(&Serial); // Use the hardware serial port on Arduino Uno

void setup()
{
 Serial.begin(115200);
 sensor.modifyFrequency(FREQUENCY_10HZ);
}

void loop()
{
 if (sensor.available()) {
   Serial.print("Acc\t"); Serial.print(sensor.Acc.X); Serial.print("\t");
   Serial.print(sensor.Acc.Y); Serial.print("\t"); Serial.println(sensor.Acc.Z); //acceleration information of X,Y,Z
   Serial.print("Gyro\t"); Serial.print(sensor.Gyro.X); Serial.print("\t");
   Serial.print(sensor.Gyro.Y); Serial.print("\t"); Serial.println(sensor.Gyro.Z); //angular velocity information of X,Y,Z
   Serial.print("Angle\t"); Serial.print(sensor.Angle.X); Serial.print("\t");
   Serial.print(sensor.Angle.Y); Serial.print("\t"); Serial.println(sensor.Angle.Z); //angle information of X, Y, Z
   Serial.println();
 }
}


I don't know what is going on, but I do not see anything on serial monitor.
Do any of you know what may be the problem? Sketch uploads without problems but no data received from sensor

2023-08-25 03:48:59

Hello, works properly. I switched Arduino module, probably was something wrong with the one i was using

userHeadPic Nikodem.Slezinski
2023-08-24 21:36:10

I tested it, maybe there is a problem with the library. I will give feedback to the R&D department.

userHeadPic Afra