raspberrypi/gpio/info_pin.c
aixiao 084f378a18 20180911
增加 dth11 温度湿度传感器
目前工作的有DS18B20温度传感、DTH11温度湿度传感器
未测试的有info_sound、info_ultrasound、info_infrared二进制程序

	修改:     gpio/Makefile
	新文件:   gpio/conf/info.conf
	新文件:   gpio/dth11.c
	删除:     gpio/info_infrared
	修改:     gpio/info_infrared.c
	删除:     gpio/info_light
	修改:     gpio/info_light.c
	删除:     gpio/info_pin
	修改:     gpio/info_pin.c
	删除:     gpio/info_sound
	修改:     gpio/info_sound.c
	删除:     gpio/info_ultrasound
	修改:     gpio/info_ultrasound.c
	修改:     gpio/log/light.pid
	修改:     gpio/log/wind.pid
	新文件:   gpio/log/wind_daemon.pid
	删除:     gpio/wind
	修改:     gpio/wind.c
2018-09-11 14:35:16 +00:00

24 lines
312 B
C

/* 测试PIN脚是否1或0
*
*
*/
#include <wiringPi.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
if( argc != 2) {
exit(0);
}
int pin = atol(argv[1]);
wiringPiSetup();
pinMode(pin, OUTPUT);
printf("%d\n", digitalRead(pin));
return pin;
}