Reading multiple bytes on a specific address of an sensor on an arduino at once
Mostra commenti meno recenti
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 Commenti
Sid Jhaveri
il 29 Ago 2018
Can you share the datasheet of the sensor? Is it 8 bytes of data in a single register or spread over multiple registers?
Philip Lorenz
il 30 Ago 2018
Sid Jhaveri
il 30 Ago 2018
The read function has numBytes as input argument. That might help you in reading more than 1 bytes from Arduino.
Risposte (2)
AKARSH KUMAR
il 24 Giu 2020
0 voti
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
il 24 Gen 2021
0 voti
Did you solved the Problem ?
Categorie
Scopri di più su Device Driver Blocks in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!