MCP4018 library

Dependents:   mbed_MCP4018

See https://developer.mbed.org/users/yasuyuki/notebook/MCP4018/

MCP4018.cpp

Committer:
yasuyuki
Date:
2014-11-08
Revision:
0:f32b8e382343

File content as of revision 0:f32b8e382343:

//**********************
// MCP4018.cpp for mbed
//
// MCP4018 mcp4018(P0_5,P0_4);
// or
// I2C i2c(P0_5,P0_4);
// MCP4018 mcp4018(i2c);
//
// (C)Copyright 2014 All rights reserved by Y.Onodera
// http://einstlab.web.fc2.com
//**********************

#include "mbed.h"
#include "MCP4018.h"

MCP4018::MCP4018 (PinName sda, PinName scl) : _i2c(sda, scl) {
}
MCP4018::MCP4018 (I2C& p_i2c) : _i2c(p_i2c) {
}


void MCP4018::put(unsigned char a)
{

    buf[0]=0x7F & a;
    _i2c.write(MCP4018_ADDR, buf, 1);
 
}