필터 지우기
필터 지우기

Reading multiple bytes on a specific address of an sensor on an arduino at once

조회 수: 3 (최근 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
Philip Lorenz
Philip Lorenz 2018년 8월 30일
the datasheet link: CCS811, as far as i know the 8 Bytes of data are in one Register.
Sid Jhaveri
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
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');

Michael Lipp
Michael Lipp 2021년 1월 24일
Did you solved the Problem ?

카테고리

Help CenterFile Exchange에서 Modeling에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by