Giter Club home page Giter Club logo

Comments (7)

KannanNatesh avatar KannanNatesh commented on August 22, 2024

Dear Friends,
for your reference i add some code what i write for get raw value from accelerometer registers.
i have read accelero meter value with this code
u8 accreg[6]={0x3B,0x3C,0x3D,0x3E,0x3F,0x40,0x00};
u8 read_buffer[8]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
ret = Ql_IIC_Write_Read(1, addr, accreg, 1,read_buffer, 6); //1-is Channel, addr=0xd0, accreg-is accelero meter registers 1=must be true for communication enable, read_buffer-is read data from slave registers, 6= registers length;
dec_accx=(read_buffer[0]<<8) | read_buffer[1];
dec_accy=(read_buffer[2]<<8) | read_buffer[3];
dec_accz=(read_buffer[4]<<8) | read_buffer[5];
SerialPrint("--AX%d",dec_accx);
SerialPrint("--AY%d",dec_accy);
SerialPrint("--AZ%d",dec_accz);

thank you

with regards
kannannatesh.S

from mpu6050.

kriswiner avatar kriswiner commented on August 22, 2024

from mpu6050.

KannanNatesh avatar KannanNatesh commented on August 22, 2024

Dear kriswiner,
ya that is my question, my controller connect 0xd0 address with Accelerometer, so 0x75 register returns 0x58, my controller read data in only 8bytes in single transmission,

and one thing i am newbie for I2C Communication so i don't know to how to read/write data to the registers

the below code shows my controller how to read data from registers
must i write address for each transmission like
u8 accreg[6]={0x3B,0x3C,0x3D,0x3E,0x3F,0x40,0x00};
this above char store 6 byte address for read 6 registers,
ret = Ql_IIC_Write_Read(1, addr, accreg, 1,read_buffer, 6); //1-is Channel, addr=0xd0, accreg-is accelero meter registers 1=must be true for communication enable, read_buffer-is read data from slave registers, 6= registers length;

my doubt is
if i read single byte data from FIFO 0x74 register that data is still available in same register or that is Automatically erased,
because i send request to read 2nd byte data from same address 0x74 register that is read same data(like first request read data) or not.

sorry for my non grammatical English
I hope you understand my doubt/question

thank you

with regards
kannannatesh

from mpu6050.

kriswiner avatar kriswiner commented on August 22, 2024

from mpu6050.

KannanNatesh avatar KannanNatesh commented on August 22, 2024

Dear kriswiner,
thanks for your suggestion that is ok for my project but already board was designed with MPU6050 so i can't change the module,

if you can please help to clear my doubt
if i read first byte from 0x74 FIFO register that byte is still available in FIFO register or that is automatically erased.

thank you'

with regards
kannannatesh

from mpu6050.

kriswiner avatar kriswiner commented on August 22, 2024

from mpu6050.

KannanNatesh avatar KannanNatesh commented on August 22, 2024

k thank you

from mpu6050.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.