-
大小: 2.84MB文件类型: .rar金币: 1下载: 0 次发布日期: 2023-09-15
- 语言: 其他
- 标签:
资源简介
智能家居系统 源代码 arm9 2440 (服务器 和 客户端pc,手机),真实的项目源码。用户可以通过手机来控制智能设备和监控视频,带有服务器数据库
代码片段和文件信息
#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个文件信息
- 上一篇:STM32F103RCT6 12864液晶驱动
- 下一篇:信息学竞赛国家集训队论文集
评论
共有 条评论