Skip to content

molnarkares/max11200_arduino

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

max11200_arduino

MAX11200 ADC Arduino library

Usage

Includes

#include "max11200.h"

#include "SPI.h"

Instantiation

Max11210 sensor(SPI, PIN_SPI_SS, PIN_SPI_MISO);

Where

  • SPI is the instance of the SPI driver class,
  • PIN_SPI_SS is the peripheral select pin connected to MAX11200 and
  • PIN_SPI_MISO is the MISO pin of SPI

Initialization

You shall call sensor.begin(); to initialize the sensor in the Arduino setup() function.

Reading data

First check if the data acquisition has completed yet by calling _sensor.waitForReady(t); where t is a wait timeout in milliseconds. If waitForReady returns true, you can call sensor.analogReadUnsigned() or sensor.analogReadSigned() depending on the application configuration.

Configuration

After initialization with begin() you can set up the max11200 parameters with the following APIs:

  • sensor.config(val); where val is the desired value of the CTRL1 register of the device. Check max11200.h for the pre-defined values. Example: sensor.config(Max11210::linef|Max11210::ub);

  • sensor.setRate(rate); will set the conversion rate. Check max11200.h for the pre-defined values. Example: sensor.setRate(Max11210::rate::rate120sps);

Controlling the digital IOs of MAX11200

You can configure the digital IO pins of the device with the pinMode(pin,direction) method. Example: sensor.pinMode(Max11210::dPin::gpio4,Max11210::dMode::output);

Then get or set the digital values via the digitalWrite and digitalRead APIs. Example: sensor.digitalWrite(Max11210::dPin::gpio4,Max11210::dVal::low);

Calibration

Only the self calibration is implemented and it is called by the begin() method at startup. If needed, the self calibration can be triggered via calling the calibrateSelf() method.

About

MAX11200 ADC Arduino library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages