LM75
用于传感器 LM75 的 Raspberry Pi C 驱动程序。
示例用法
C语言
# include " lm75.h "
# include < unistd>
# include < stdio>
int main ( int argc, char **argv){
char *i2c_device = " /dev/i2c-1 " ;
int address = 0x48 ;
void *lm = lm75_init (address, i2c_device);
if (lm != NULL ){
int i;
for (i = 0 ; i < 10 ; i++) {
float t = lm75_temperature (lm);
printf ( " t = %f \n " , t);
usleep ( 2 *
2022-05-14 17:49:12
7KB
C
1