Roboremo with MPU 6050
2 posters
Page 1 of 1
Roboremo with MPU 6050
Hi everyone,
Is there any possibilities to get plot drawing a graph for one of six variables from MPU 6050 (Accelerometer + Gyro).
I'm getting all variables in text field in roboremo, I would like to plot a graph from them (one axis).
Arduino code suggestions?
Is there any possibilities to get plot drawing a graph for one of six variables from MPU 6050 (Accelerometer + Gyro).
I'm getting all variables in text field in roboremo, I would like to plot a graph from them (one axis).
Arduino code suggestions?
Vicc- Posts : 7
Join date : 2016-06-07
Re: Roboremo with MPU 6050
Hi,
If you get them in text field, you can plot them too, just need to configure the plot. Show me a screenshot with the text field with data and the id of the text field, and I will try to help.
If you get them in text field, you can plot them too, just need to configure the plot. Show me a screenshot with the text field with data and the id of the text field, and I will try to help.
Re: Roboremo with MPU 6050
here's my code in arduino:
here's what I'm getting inserting a text log in roboremo:
the same I get in serial on pc:
I'm not adding id to text log (not the text field, my mistake), just inserting it and getting this. I want to plot AcX axis for example.
Thanks!
- Code:
#include<Wire.h>
#define bluetooth Serial
#pragma GCC diagnostic ignored "-Wwrite-strings"
const int MPU_addr=0x68; // I2C address of the MPU-6050
int16_t AcX,AcY,AcZ,Tmp,GyX,GyY,GyZ;
void setup(){
Wire.begin();
Wire.beginTransmission(MPU_addr);
Wire.write(0x6B); // PWR_MGMT_1 register
Wire.write(0); // set to zero (wakes up the MPU-6050)
Wire.endTransmission(true);
Serial.begin(9600);
bluetooth.begin(9600);
}
void loop(){
Wire.beginTransmission(MPU_addr);
Wire.write(0x3B); // starting with register 0x3B (ACCEL_XOUT_H)
Wire.endTransmission(false);
Wire.requestFrom(MPU_addr,14,true); // request a total of 14 registers
AcX=Wire.read()<<8|Wire.read(); // 0x3B (ACCEL_XOUT_H) & 0x3C (ACCEL_XOUT_L)
AcY=Wire.read()<<8|Wire.read(); // 0x3D (ACCEL_YOUT_H) & 0x3E (ACCEL_YOUT_L)
AcZ=Wire.read()<<8|Wire.read(); // 0x3F (ACCEL_ZOUT_H) & 0x40 (ACCEL_ZOUT_L)
Tmp=Wire.read()<<8|Wire.read(); // 0x41 (TEMP_OUT_H) & 0x42 (TEMP_OUT_L)
GyX=Wire.read()<<8|Wire.read(); // 0x43 (GYRO_XOUT_H) & 0x44 (GYRO_XOUT_L)
GyY=Wire.read()<<8|Wire.read(); // 0x45 (GYRO_YOUT_H) & 0x46 (GYRO_YOUT_L)
GyZ=Wire.read()<<8|Wire.read(); // 0x47 (GYRO_ZOUT_H) & 0x48 (GYRO_ZOUT_L)
Serial.print("AcX = "); Serial.print(AcX);
Serial.print(" | AcY = "); Serial.print(AcY);
Serial.print(" | AcZ = "); Serial.print(AcZ);
Serial.print(" | Tmp = "); Serial.print(Tmp/340.00+36.53); //equation for temperature in degrees C from datasheet
Serial.print(" | GyX = "); Serial.print(GyX);
Serial.print(" | GyY = "); Serial.print(GyY);
Serial.print(" | GyZ = "); Serial.println(GyZ);
delay(100);
}
here's what I'm getting inserting a text log in roboremo:
the same I get in serial on pc:
I'm not adding id to text log (not the text field, my mistake), just inserting it and getting this. I want to plot AcX axis for example.
Thanks!
Vicc- Posts : 7
Join date : 2016-06-07
Re: Roboremo with MPU 6050
Hi,
replace this:
Then set interface cmd ending to "\n"
and plot id to "AcX = " (without quotes)
and set plot min and max values according to your need.
replace this:
- Code:
Serial.print("AcX = "); Serial.print(AcX);
Serial.print(" | AcY = "); Serial.print(AcY);
Serial.print(" | AcZ = "); Serial.print(AcZ);
Serial.print(" | Tmp = "); Serial.print(Tmp/340.00+36.53); //equation for temperature in degrees C from datasheet
Serial.print(" | GyX = "); Serial.print(GyX);
Serial.print(" | GyY = "); Serial.print(GyY);
Serial.print(" | GyZ = "); Serial.println(GyZ);
- Code:
Serial.print("AcX = "); Serial.println(AcX);
Serial.print("AcY = "); Serial.println(AcY);
Serial.print("AcZ = "); Serial.println(AcZ);
Serial.print("Tmp = "); Serial.println(Tmp/340.00+36.53);
Serial.print("GyX = "); Serial.println(GyX);
Serial.print("GyY = "); Serial.println(GyY);
Serial.print("GyZ = "); Serial.println(GyZ);
Then set interface cmd ending to "\n"
and plot id to "AcX = " (without quotes)
and set plot min and max values according to your need.
Re: Roboremo with MPU 6050
thank you,
don't know how to set interface cmd to "\n" but plotting function is working great. Thank you very much!!!
don't know how to set interface cmd to "\n" but plotting function is working great. Thank you very much!!!
Vicc- Posts : 7
Join date : 2016-06-07
Similar topics
» DS18 sensors & RoboRemo
» roboremo + esp8266 + arduino ?
» RoboRemo Forum
» How to integrate RoboRemo in my code?
» Using Roboremo with Raspberry Pi
» roboremo + esp8266 + arduino ?
» RoboRemo Forum
» How to integrate RoboRemo in my code?
» Using Roboremo with Raspberry Pi
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|