MCP4726 library

Dependents:   mbed_MCP4726

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MCP4726.h Source File

MCP4726.h

00001 //**********************
00002 // MCP4726.h for mbed
00003 //
00004 // (C)Copyright 2014 All rights reserved by Y.Onodera
00005 // http://einstlab.web.fc2.com
00006 //**********************
00007 
00008 #ifndef MCP4726_H_
00009 #define MCP4726_H_
00010 
00011 #define MCP4726_ADDR                0xC0
00012 
00013 #include "mbed.h"
00014 #include "typedef.h"
00015 
00016 
00017 class MCP4726{
00018 public:
00019     MCP4726 (PinName sda, PinName scl);
00020     MCP4726 (I2C& p_i2c);
00021     void init();
00022     void put(unsigned short a);
00023 
00024 protected:
00025     
00026     I2C _i2c;
00027 
00028     WORD_VAL da;
00029     char buf[3];
00030 
00031 };
00032 
00033 #endif /* MCP4726_H_ */
00034 
00035 
00036