upm  0.1.8
Sensor/Actuator repository for libmraa (v0.4.5)
 All Data Structures Files Functions Variables Macros Pages
Public Member Functions | Static Public Attributes
MAX5487 Class Reference

C++ API for MAX5487 chip (SPI digital potentionmeter) More...

Detailed Description

The Maxim Integrated MAX5487 is a Dual, 256-Tap, Nonvolatile, SPI-Interface, Linear-Taper Digital Potentiometer. This module was tested on the Maxim Integrated MAX5487PMB1 PMOD module from the analog PMOD kit.

sensor = new upm::MAX5487(7);
// Power LED UP
for (int i = 0; i < 255; i++) {
sensor->setWiperA(i);
usleep (5000);
}
// Power LED DOWN
for (int i = 0; i < 255; i++) {
sensor->setWiperA(255 - i);
usleep (5000);
}
max5487.jpeg

Public Member Functions

 MAX5487 (int csn)
 
 ~MAX5487 ()
 
void setWiperA (uint8_t wiper)
 
void setWiperB (uint8_t wiper)
 
std::string name ()
 

Static Public Attributes

static const uint8_t R_WR_WIPER_A = 0x01
 
static const uint8_t R_WR_WIPER_B = 0x02
 

Constructor & Destructor Documentation

MAX5487 ( int  csn = -1)

Instanciates a MAX5487 object

Parameters
csnto use if any, by default will use ICSP CS (-1)
~MAX5487 ( )

MAX5487 object destructor, closes all IO connections

Member Function Documentation

void setWiperA ( uint8_t  wiper)

Set wiper for port A.

void setWiperB ( uint8_t  wiper)

Set wiper for port B.

std::string name ( )
inline

Return name of the component


The documentation for this class was generated from the following files: