Hello,
for my application I use Arduino UNO
and CHR-6d IMU (datasheet : pololu.com/file/0J342/chr6d_datasheet.pdf)
I have problems with communication between board and sensor. I have almost no experience in programming so I would need some help how to send proper packets to sensor and see response.
I think I wired it correctly. 3.3V to 3.3V, GND to GND, Rx to Tx, and Tx to Rx.
Below is my code, which is not working.
#include <SoftwareSerial.h>
#define rxPin 0
#define txPin 1
SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin);
uint8_t SET_SILENT_MODE[] = {
0x73, 0x6E, 0x70, 0x83,0x00, 0x01, 0x2B};
uint8_t GET_DATA[] = {
0x73, 0x6E, 0x70, 0x01, 0x00, 0x01, 0x52};
uint8_t SET_BROADCAST_MODE[] = {
0x73,0x6E,0x70,0x84,0x01,0x05,0x01,0x24};
void setup() {
mySerial.begin(115200);
Serial.begin(115200);
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
delay(500);
mySerial.write(SET_SILENT_MODE,sizeof(SET_SILENT_MODE));
}
void loop() {
if (Serial.available()>0){
char c = Serial.read();
Serial.print(c, HEX);
}
}
Problem is i don’t get any response in Serial Monitor. Can you help me with the code?
Thanks in advance,
best regards,