bromagosa / Snap4Arduino

Binding Snap! and Arduino together
http://snap4arduino.rocks
GNU Affero General Public License v3.0
133 stars 85 forks source link

ACCELEROMETER + GIRÓSCOPE MPU-6050 I2C communication #281

Closed IlundainIlundain closed 1 year ago

IlundainIlundain commented 5 years ago

I would like to use this Arduino component with program, but I do not know how to do it, where can I get a library? How is it added? Are there web pages where there are more librarians? Thank you

jguille2 commented 5 years ago

Hi @IlundainIlundain , On the board site, you don't need libraries, because Firmata supports I2C connection. So Snap4Arduino is able to play with this sensor.

But, this is not direct!

Inside the Snap4Arduino, you can load the "i2c" library. And you will get the "i2c basic block" to do this job. But there is quite work to get the results you want... Reading board specifications o reading other implementations (like this https://github.com/jrowberg/i2cdevlib/tree/master/Arduino/MPU6050) you can do this work.

I would like to help you in more detail, but I do not have any sensor like this to test.

Joan

IlundainIlundain commented 5 years ago

Thank you very much for the response and your time. I would like to make a drone with my students and I need something similar to an accelerometer / giroscope will not you know something similar? I know how to do it in Arduino but not with a program based on Scratch (S4A, mBot ...) For kids, I would like to use a program based on Scratch. THANK YOU

El mié., 15 may. 2019 a las 14:32, Joan Guillén i Pelegay (< notifications@github.com>) escribió:

Hi @IlundainIlundain https://github.com/IlundainIlundain , On the board site, you don't need libraries, because Firmata supports I2C connection. So Snap4Arduino is able to play with this sensor.

But, this is not direct!

Inside the Snap4Arduino, you can load the "i2c" library. And you will get the "i2c basic block" to do this job. But there is quite work to get the results you want... Reading board specifications o reading other implementations (like this https://github.com/jrowberg/i2cdevlib/tree/master/Arduino/MPU6050) you can do this work.

I would like to help you in more detail, but I do not have any sensor like this to test.

Joan

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bromagosa/Snap4Arduino/issues/281?email_source=notifications&email_token=AMCQSZV6WLELSLXRZTZ2AITPVP7FBA5CNFSM4HNCDNH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVOQFHI#issuecomment-492634781, or mute the thread https://github.com/notifications/unsubscribe-auth/AMCQSZURNEL6HQEAJ2RNDJ3PVP7FBANCNFSM4HNCDNHQ .

wandiufo commented 2 years ago

Now I am working to use i2c MPU6050. I have tried using available snap block for i2c but not success, then I put the simple worked MPU6050 code to firmata. I can get a byte and int from snap4arduino but I have difficulties to get them in array in JS snap block. Could you inform me how to pass array from arduino firmata to snap ?

Best regards Irwandi

jguille2 commented 2 years ago

Hi Irwandi,

Maybe the LCD example at the other issue (https://github.com/bromagosa/Snap4Arduino/issues/294#issuecomment-1281680434) helps you to test i2c devices (in general)

Test that before and we can continue later here. Continue...

Joan