Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
MCP3424.h
00001 /* 00002 This Library for ADC MCP3424. 00003 I modif from ibrary at https://github.com/battosai30/MCP3424 00004 I wish it's working good. 00005 */ 00006 00007 #ifndef MCP3424_H 00008 #define MCP3424_H 00009 00010 #include "mbed.h" 00011 //#include <math.h> 00012 00013 #define MCP3424_ADDR 0xD0 00014 #define MCP3424_FREQ 100000 00015 00016 class MCP3424 { 00017 00018 public: 00019 00020 MCP3424(PinName sda, PinName scl); 00021 ~MCP3424(); 00022 bool Config(uint8_t channel,uint8_t resolution,bool mode,uint8_t PGA); 00023 bool NewConversion(); 00024 bool IsConversionFinished(); 00025 long Measure(); 00026 00027 private: 00028 00029 I2C mcp3424_i2c; 00030 00031 uint8_t _adresse; 00032 long _resultat; 00033 uint8_t _resolution; 00034 bool _mode; 00035 uint8_t _i; 00036 uint8_t _testvariable; 00037 uint8_t _cfgbyte; 00038 uint8_t _PGA; 00039 uint8_t _RequestedByte; 00040 uint8_t _Buffer[4]; 00041 char _recvBuff[8]; 00042 long _res; 00043 }; 00044 00045 #endif
Generated on Tue Jul 12 2022 18:36:21 by
