Adafruit DS3502 Arduino Library
Adafruit_DS3502.h
Go to the documentation of this file.
1 
17 #ifndef _ADAFRUIT_DS3502_H
18 #define _ADAFRUIT_DS3502_H
19 
20 #include "Arduino.h"
21 #include <Wire.h>
22 
23 #include <Adafruit_BusIO_Register.h>
24 #include <Adafruit_I2CDevice.h>
25 
26 #define DS3502_I2CADDR_DEFAULT 0x28
27 
28 #define DS3502_WIPER 0x00
29 #define DS3502_MODE 0x02
30 
31 
36 public:
38  bool begin(uint8_t i2c_addr = DS3502_I2CADDR_DEFAULT, TwoWire *wire = &Wire);
39  uint8_t getWiper(void);
40  void setWiper(uint8_t new_wiper_value);
41  void setWiperDefault(uint8_t new_wiper_default);
42 
43  Adafruit_BusIO_Register
45 
46 private:
47  Adafruit_I2CDevice *i2c_dev;
48 };
49 
50 #endif
Class that stores state and functions for interacting with the DS3502 I2C Potentiometer.
Definition: Adafruit_DS3502.h:35
void setWiper(uint8_t new_wiper_value)
Sets the potentiometer wiper to a new value.
Definition: Adafruit_DS3502.cpp:83
#define DS3502_I2CADDR_DEFAULT
DS3502 default I2C address.
Definition: Adafruit_DS3502.h:26
uint8_t getWiper(void)
Gets the current value of the wiper register.
Definition: Adafruit_DS3502.cpp:71
Adafruit_BusIO_Register * mode_selector
BusIO Register for selecting the write mode.
Definition: Adafruit_DS3502.h:44
void setWiperDefault(uint8_t new_wiper_default)
Sets the Wiper and IVR (Initial Value Register) to the given value.
Definition: Adafruit_DS3502.cpp:101
bool begin(uint8_t i2c_addr=DS3502_I2CADDR_DEFAULT, TwoWire *wire=&Wire)
Sets up the hardware and initializes I2C.
Definition: Adafruit_DS3502.cpp:52
Adafruit_DS3502()
Instantiates a new DS3502 class.
Definition: Adafruit_DS3502.cpp:42