-
Notifications
You must be signed in to change notification settings - Fork 0
/
Adafruit_MCP4725.h
39 lines (30 loc) · 1.04 KB
/
Adafruit_MCP4725.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**************************************************************************/
/*!
@file Adafruit_MCP4725.h
@author K. Townsend (Adafruit Industries)
@license BSD (see license.txt)
This is a library for the Adafruit MCP4725 breakout board
----> http://www.adafruit.com/products/935
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
@section HISTORY
v1.0 - First release
*/
/**************************************************************************/
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include <Wire.h>
#define MCP4726_CMD_WRITEDAC (0x40) // Writes data to the DAC
#define MCP4726_CMD_WRITEDACEEPROM (0x60) // Writes data to the DAC and the EEPROM (persisting the assigned value after reset)
class Adafruit_MCP4725{
public:
Adafruit_MCP4725();
void begin(uint8_t a);
void setVoltage( uint16_t output, bool writeEEPROM );
private:
uint8_t _i2caddr;
};