I2C programming

I am new about UP square board, so for many of you this post could be not useful. I am trying to use I2C bus for a project that I am going to implement. To make a test a took a gyroscope/accelerometer based on MPU6050 chip (GY-521). I installed the mraa libraries and python libraries suggested in the wiki.
with i2cdetect I find the device recognized in the board (address 0x68) : sudo i2cdetect -r -y 5
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
So I suppose that the bus is number 5 and I wrote this simple code:
import mraa as m
x = m.I2c(0x05) # the bus number
x.address(0x68) # the address of sensor
Running the test I get:
Traceback (most recent call last):
File "test.py", line 3, in
x = m.I2c(0x05)
File "/usr/lib/python3.6/dist-packages/mraa.py", line 507, in init
this = _mraa.new_I2c(bus, raw)
ValueError: Invalid i2c bus
What is wrong ?
Thanks
Massimo
Tagged
Categories
- All Categories
- 105 Announcements & News
- 54 Product News - New Product/Product Change Notice/ End-of-life
- 185 Welcome Developers!
- 55 Unboxing & Project Sharing
- 48 Tech Updates
- 693 UP Products
- 11 UP 7000
- 1 UP Squared i12
- 10 UP Xtreme i12
- 11 UP Squared Pro 7000
- 1 UP Element i12 Edge
- 19 UP Squared V2
- 59 UP 4000
- 24 UP Xtreme i11
- 35 UP Squared 6000
- 60 UP Squared Pro
- 143 UP Xtreme
- 837 UP Squared
- 1.4K UP Board
- 89 UP Core Plus
- 222 UP Core
- 3 UP Xtreme Lite
- 44 UP AI Edge
- 216 Starter Kits & Peripheral