PCF8591 library

Dependents:   mbed_DEMO

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers PCF8591.h Source File

PCF8591.h

00001 //**********************
00002 // PCF8591.h for mbed
00003 //
00004 // (C)Copyright 2014 All rights reserved by Y.Onodera
00005 // http://einstlab.web.fc2.com
00006 //**********************
00007 
00008 #ifndef PCF8591_H_
00009 #define PCF8591_H_
00010 
00011 #define PCF8591_ADDR    0x92
00012 
00013 #include "mbed.h"
00014 
00015 class PCF8591{
00016 public:
00017     PCF8591 (PinName sda, PinName scl);
00018     PCF8591 (I2C& p_i2c);
00019 
00020     void put(unsigned char a, unsigned char b);
00021     unsigned char get(unsigned char a);
00022 
00023 protected:
00024     
00025     I2C _i2c;
00026     char buf[2];
00027 
00028 };
00029 
00030 
00031 #endif /* PCF8591_H_ */