智能家居实战——-树莓派之继电器控制二楼灯
一、在controlDevices.h中
struct Devices
{
char deviceName[128];
int status;
int pinNum;
int (*open)(int pinNum);
int (*close)(int pinNum);
int (*deviceInit)(int pinNum);
int (*readStatus)(int pinNum);
int (*changeStatus)(int status);
struct Devices *next;
};
struct Devices *addBathroomLightToDeviceLink(struct Devives *phead)
二、在upstairLight.c中
#include"contrlDevices.h"
#include
int upst
共有 0 条评论