Warning: Cannot query I2C bus speed.

2 ビュー (過去 30 日間)
Mario Frischmann
Mario Frischmann 2017 年 8 月 30 日
コメント済み: Morteza aliyari 2017 年 11 月 24 日
Hy everybody,
I am usining a Raspberry Pi 3 Model B V1.2 and the Support Package for Raspberry Pi.
With the Matlabcommand
mypi = raspi
I can connect to my Raspberry Pi but at the first time I use this command I alwas get following warning:
Warning: Cannot query I2C bus speed.
If I use the commands
disableI2C(mypi)
enableI2C(mypi,400000)
once and clear the variable mypi and try the comment mypi = raspi again it can query the I2C bus speed (40000)
Can anyone help me so it will work at the first time? I use Matlab 2016b
Thank you very much
  1 件のコメント
Morteza aliyari
Morteza aliyari 2017 年 11 月 24 日
hi,i recommend enable i2c from raspberry pi terminal with: sudo raspi-config and add bus speed to your config.txt on rpi3b. it work for me.

サインインしてコメントする。

回答 (1 件)

Manish Annappa
Manish Annappa 2017 年 9 月 7 日
In order to get more information on the issue, post the output of the following commands
a) Create connection to Raspberry Pi (for the first time)
>> mypi = raspi
b) List all the available I2C bus available and their speed
>> mypi.AvailableI2CBuses
>> mypi.I2CBusSpeed
c) Scan all the I2C buses available to get its address. '<name>' is obtained from the output of mypi.AvailableI2CBuses.
>> scanI2CBus(mypi,'<name>')
d) Create a connection to all the addresses obtained in the above step for every I2C bus.
>> i2cdac = i2cdev(mypi,'<name>','<address>')
e) Write value to every I2C bus connected in above step
>> write(i2cdac,4092)
Refer to the link below for more information on the commands:
https://www.mathworks.com/help/releases/R2016b/supportpkg/raspberrypiio/ug/use-the-i2c-interface-on-the-raspberry-pi-hardware.html

カテゴリ

Help Center および File ExchangeMATLAB Support Package for Raspberry Pi Hardware についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by