I2Cdevlib Forums # Piyumal

Members

3

• #### Days Won

3

Piyumal had the most liked content!

• Rank
Newbie

## Recent Profile Visitors

1,784 profile views

• ### maza324

1. Hello friends, I am trying to make a self balancing robot, so I found some tutorials regarding Complementary filters. In that tutorial there is a equation for take acceleration and gyro value, these are the equation, x_acc = (x_acc_ADC - x_acc_offset) * x_acc_scale; gyro = (gyro_ADC - gyro_offset) * gyro_scale; form that I obtained following values, ax= 0 gy= -159 x_acc= 148.00 gyro= 11000.00 ax= -116 gy= -184 x_acc= -84.00 gyro= -1500.00 ax= -40 gy= -175 x_acc= 68.00 gyro= 3000.00 ax= -48 gy= -177 x_acc= 52.00 gyro= 2000.00 ax= 4 gy= -183 x_acc= 156.00 gyro= -1000.00 ax= -60 gy= -190 x_acc= 28.00 gyro= -4500.00 ax= -84 gy= -192 x_acc= -20.00 gyro= -5500.00 ax= -92 gy= -184 x_acc= -36.00 gyro= -1500.00 ax= -88 gy= -164 x_acc= -28.00 gyro= 8500.00 Here is my code, #include <Wire.h> #include <I2Cdev.h> #include <MPU6050.h> MPU6050 mpu; int16_t ax, ay, az; int16_t gx, gy, gz; float x_acc, gyro; void setup() { // put your setup code here, to run once: Serial.begin(1200); Serial.println("Initialize MPU"); mpu.initialize(); } void loop(){ mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz); Serial.print("ax= "); Serial.print(ax); Serial.print("\t\t"); Serial.print("gy= "); Serial.print(gy); Serial.print("\t\t"); x_acc= (ax - (-74))*(2); Serial.print("x_acc= "); Serial.print(x_acc); Serial.print("\t\t"); gyro= (gy - (-181))*(500); Serial.print("gyro= "); Serial.print(gyro); Serial.print("\n"); } Please let me know whether that values are correct or not, if it is not please help me to correct it.. Thank you!
2. I installed "Simulink Support package for Arduino" for Matlab, after the installation MPU6050 is not working with Arduino Mega, I think there is problem with I2C bus, so how I can solve that problem. Thank you!
3. am trying to make gesture control car for my university mini project. I am using MPU6050 and nRF24l01, separately both are working, but I can't combine both and i can't control a motor according to the motion of MPU6050. please your help is highly appreciated. (i am new to Arduino).. thank you. i have used MPU6050 and Mirf libraries..
×
{"ft_lang_label":"__label__en","ft_lang_prob":0.5289433,"math_prob":0.90872705,"size":1518,"snap":"2019-51-2020-05","text_gpt3_token_len":512,"char_repetition_ratio":0.22853369,"word_repetition_ratio":0.0,"special_character_ratio":0.4433465,"punctuation_ratio":0.24068768,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9956771,"pos_list":[0,1,2,3,4],"im_url_duplicate_count":[null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-12-14T10:02:19Z\",\"WARC-Record-ID\":\"<urn:uuid:ca383d0d-a987-4f5c-9ad0-80d92a12bc9b>\",\"Content-Length\":\"51452\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:100d032e-4ee3-41b8-8684-6fcb4dc7357b>\",\"WARC-Concurrent-To\":\"<urn:uuid:d031f15d-fa49-4c90-b522-abf0f9d0c593>\",\"WARC-IP-Address\":\"50.56.173.86\",\"WARC-Target-URI\":\"https://www.i2cdevlib.com/forums/profile/1787-piyumal/\",\"WARC-Payload-Digest\":\"sha1:BKYO7DQK4463R5FV3TXW4TASGUQTU6AO\",\"WARC-Block-Digest\":\"sha1:HOK2SUYUOQFI2MASGPE2NM3TU4OEKEMS\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-51/CC-MAIN-2019-51_segments_1575540586560.45_warc_CC-MAIN-20191214094407-20191214122407-00410.warc.gz\"}"}