资源简介
智能家居系统 源代码,这是一份很不错的学习代码,希望可以帮助学习的人哦!

代码片段和文件信息
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include “pthread.h“
#include “SockMsgFormat.h“
#include “MachineMajor.h“
#include “VideoCapture.h“
#define ADC_DEV “/dev/adc/0raw“
#define DCM_DEV “/dev/dcm/0raw“
#define STEP_DEV “/dev/exio/0raw“
#define DCM_IOCTRL_SETPWM 0x10
#define DCM_TCNTB0 16384
#define STEPMOTOR_IOCTRL_PHASE 0x13
#define SERVPORT 2312
#define MAXBUFSIZE 100
#define BACKLOG 20
#define MAXTHREAD 10
//define the scope of temperature and humidity
#define MAX_TEMPERATURE 38
#define MIN_TEMPERATURE 18
#define MAX_HUMIDITY 80
#define MIN_HUMIDITY 20
#define MAX_ROBOTSTEP 50
#define MIN_ROBOTSTEP 1
//define the default system configure
#define AUTOPEN_AIRCONDITION 1
#define AUTOPEN_HUMICONDITION 1
#define DEFAULT_TEMPERATURE 38
#define DEFAULT_HUMIDITY 35
#define DEFAULT_ROBOTSTEP 5
#define DEFAULT_ROBOTCENTERX 320
#define DEFAULT_ROBOTCENTERY 240
#define DEFAULT_ROBOTDIRECTION 0
#define DEFAULT_SPEED 100
struct CurrentParam
{
bool door_state;
bool aircon_state;
bool cooker_state;
bool humi_state;
int temperature;
int humidity;
int speed;
};
struct SystemConfigure
{
bool autopen_aircondition;
bool autopen_humicondition;
int default_temperature;
int default_humidity;
int default_robotstep;
int default_robotcenterX;
int default_robotcenterY;
int default_robotdirection;
int default_speed;
};
struct CurrentParam current;
struct SystemConfigure config;
int dcm_fd = -1;
int step_fd = -1;
int button = 1;
int distan_angle;
bool bexit = false;
int UpOrdown = 1;
int factor = DCM_TCNTB0/1024;
MachineMajordomo * robot = NULL;
pthread_t aircondition_th;
pthread_t humidity_th;
pthread_t vcapture_th;
pthread_t vsend_th;
void * retval;
int thread_count = 0;
pthread_mutex_t count_mutex;
pthread_mutex_t current_mutex;
pthread_mutex_t config_mutex;
pthread_mutex_t humi_mutex;
void SetDefaultConfig()
{
config.autopen_aircondition = AUTOPEN_AIRCONDITION;
config.autopen_humicondition = AUTOPEN_HUMICONDITION;
config.default_temperature = DEFAULT_TEMPERATURE;
config.default_humidity = DEFAULT_HUMIDITY;
config.default_robotstep = DEFAULT_ROBOTSTEP;
config.default_robotcenterX = DEFAULT_ROBOTCENTERX;
config.default_robotcenterY = DEFAULT_ROBOTCENTERY;
config.default_robotdirection = DEFAULT_ROBOTDIRECTION;
config.default_speed = DEFAULT_SPEED;
}
void WriteDefFile(FILE * fp)
{
if (fp == NULL)
return;
int d[12] = {AUTOPEN_AIRCONDITION AUTOPEN_HUMICONDITION 333 DEFAULT_TEMPERATURE DEFAULT_HUMIDITY DEFAULT_ROBOTSTEP 444DEFAULT_ROBOTCENTERX DEFAULT_ROBOTCENTERY 555 DEFAULT_ROBOTDIRECTION DEFAULT_SP
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
....... 3176 2008-08-15 23:10 code\arm开发板端\intelligence_home\drivers\dc-motor.o
....... 4852 2008-08-15 23:10 code\arm开发板端\intelligence_home\drivers\exio.o
....... 107296 2008-08-16 14:01 code\arm开发板端\intelligence_home\drivers\ov511.o
....... 3632 2008-08-15 23:10 code\arm开发板端\intelligence_home\drivers\s3c2410-adc.o
....... 10780 2008-08-16 16:24 code\arm开发板端\intelligence_home\drivers\videodev.o
....... 29730 2008-08-15 23:10 code\arm开发板端\intelligence_home\grab\encoder.c
....... 3903 2008-08-15 23:10 code\arm开发板端\intelligence_home\grab\encoder.h
....... 15286 2008-08-15 23:10 code\arm开发板端\intelligence_home\grab\huffman.c
....... 1885 2008-08-15 23:10 code\arm开发板端\intelligence_home\grab\huffman.h
....... 199 2008-08-15 23:10 code\arm开发板端\intelligence_home\grab\jdatatype.h
....... 6989 2008-08-15 23:10 code\arm开发板端\intelligence_home\grab\marker.c
....... 1908 2008-08-15 23:10 code\arm开发板端\intelligence_home\grab\marker.h
....... 4413 2008-08-15 23:10 code\arm开发板端\intelligence_home\grab\quant.c
....... 1866 2008-08-15 23:10 code\arm开发板端\intelligence_home\grab\quant.h
....... 26966 2008-08-15 23:10 code\arm开发板端\intelligence_home\grab\utils.c
....... 3458 2008-08-15 23:10 code\arm开发板端\intelligence_home\grab\utils.h
....... 48 2008-08-30 20:44 code\arm开发板端\intelligence_home\information.dat
....... 112697 2007-12-09 21:04 code\arm开发板端\intelligence_home\intellect_home
....... 27378 2007-12-09 21:01 code\arm开发板端\intelligence_home\intellect_home.cpp
....... 1247880 2001-02-10 14:22 code\arm开发板端\intelligence_home\libc++\libstdc++-3-libc6.1-2-2.10.0.so
....... 10944 2007-12-09 17:44 code\arm开发板端\intelligence_home\MachineMajor.cpp
....... 2370 2007-12-09 17:36 code\arm开发板端\intelligence_home\MachineMajor.h
....... 361 2008-08-21 05:51 code\arm开发板端\intelligence_home\Makefile
....... 8079 2008-08-29 15:37 code\arm开发板端\intelligence_home\MyV4L.cpp
....... 1814 2008-08-17 21:10 code\arm开发板端\intelligence_home\MyV4L.h
....... 7334 2008-08-21 16:33 code\arm开发板端\intelligence_home\SockMsgFormat.cpp
....... 1873 2008-08-20 22:54 code\arm开发板端\intelligence_home\SockMsgFormat.h
....... 164 2008-08-30 18:50 code\arm开发板端\intelligence_home\startup
....... 3105 2008-08-26 21:05 code\arm开发板端\intelligence_home\VideoCapture.cpp
....... 251 2008-08-16 15:30 code\arm开发板端\intelligence_home\VideoCapture.h
............此处省略214个文件信息
- 上一篇:网络数据库应用技术
- 下一篇:第7讲:Hive数据仓库文档
相关资源
- 基于电能信息终端的智能家居系统
- 盘点主流智能家居硬件常见的六大问
- 基于PIC的TCP/IP网络协议和zigbee无线传
- 传感器应用领域的扩大发展强劲
- 基于ZigBee技术的智能家居无线网络系
- 基于ZigBee技术的智能家居系统的设计
- 基于Zigbee技术的智能家居系统设计方
- stm32_WiFi智能家居.zip
- 物联网智能家居平台DIY:ARDUINO 物联网
- 智能家居照明控制系统设计proteus仿真
-
00.Hili
nk SDK Demo开发指导v1.3 - 基于STC89C52的GSM智能家居报警系统
- 基于单片机的智能家居系统(毕业论
- STM32智能家居程序
- 基于ZigBee的智能家居物联网系统设计
- 基于MSP430的智能家居系统设计
- 智能家居 环境温湿度采集系统
- 智能家居UDP通信
- 智能家居系统需求分析与设计文档
- 基于51单片机室内环境检测仪.zip
- 家庭物联网项目Web服务端代码
- 基于ZigBee的智能家居系统设计与实现
- 基于stm32与esp8266智能家居应用
- 基于Labview的网上家居控制平台的设计
- 汉枫_HF-LPB嵌入式WiFi模块_UART转WiFi_S
- GB T 35136-2017 智能家居自动控制设备通
- 基于单片机的室内智能空气净化器系
- 智能家居网关程序
- 智能家居系统实现源代码结构不错,
- 基于单片机的智能家居系统设计毕业
评论
共有 条评论