I’ve just got this IMUfrom ch robotics and i’m trying to poll it to get just the heading angle.
Datasheet IS clear about what I have to do to do so but i just can’t get it to work. I’m not exactly new to arduino, but I’m still getting used to it. any help I could get would be great.
http://www.chrobotics.com/docs/UM6_datasheet.pdf the device datasheet
#define PT 0x00
#define heading 0x63
unsigned int checksum;
byte checksum0,checksum1;
void setup()
{
Serial.begin(115200);
checksum='s'+'n'+'p'+PT+heading;
checksum1=checksum>>8;
checksum0=checksum & 0xFF;
}
void loop()
{
Serial.print('s');
Serial.print('n');
Serial.print('p');
Serial.write(PT);
Serial.write(heading);
Serial.write(checksum1);
Serial.write(checksum0);
while(Serial.available()<11);
for(int i=0;i<11;i++)
Serial.println(Serial.read());
}