Reading multiple bytes on a specific address of an sensor on an arduino at once
1 回表示 (過去 30 日間)
古いコメントを表示
Hey, i'm working on a CCS811 gas sensor with an arduino, they are connected through a I2C bussystem. The sensor has up to 8 bytes in the register where the gas values are saved, those registers are called mailbox in the datasheet. My question is, how can i read those registers with the Arduino Toolbox? The only command i can find are readRegister and read, i can only get int8/16 or uint8/16 from them. Are there maybe any other ways how i can get those values?
3 件のコメント
Sid Jhaveri
2018 年 8 月 30 日
The read function has numBytes as input argument. That might help you in reading more than 1 bytes from Arduino.
回答 (2 件)
AKARSH KUMAR
2020 年 6 月 24 日
m is the arduino object
dev = device (m,'I2CAddress',startingRegisterAddress)
data = readRegister(dev, startingRegisterAddress, number of bytes you want to read continuously, 'uint8');
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Arduino Hardware についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!