一·项目背景
能源生产和消费模式的重大转变,要求改变传统能源系统建设路径和发展模式。对于园区而言,如何加强园区能源管理,降低园区能耗,提高园区能源利用效率,实现人和能源,能源和能源之间的密切交互,是园区普遍面临的问题,而要打造安全,高效,清洁,低碳的绿色智慧园区。
二.实验目标
1.实时对温度,光照,湿度进行监测
2.当光照充足的时候,灯光熄灭。光照暗时,照明灯亮起。
三.实验步骤
illumi.flag |= NBIOT_UPDATED;
BH1750_test();
illumi.value.as_float = result_lx;
//添加光照值
illumi.type = NBIOT_FLOAT;
illumi.flag = NBIOT_READABLE;
ret = nbiot_resource_add(dev,
3301,
0,
5700,
&illumi);
if (ret)
{
nbiot_device_destroy(dev);
printf("device add resource(illumi) failed, code = %d.\r\n", ret);
}
//添加气压值
press.type = NBIOT_FLOAT;
press.flag = NBIOT_READABLE;
ret = nbiot_resource_add(dev,
3323,
0,
5700,
&press);
if (ret)
{
nbiot_device_destroy(dev);
printf("device add resource(press) failed, code = %d.\r\n", ret);
}
//添加led值
led.type = NBIOT_BOOLEAN;
led.flag = NBIOT_READABLE | NBIOT_WRITABLE;
ret = nbiot_resource_add(dev,
3311,
0,
5850,
&led);
if (ret)
{
nbiot_device_destroy(dev);
printf("device add resource(led) failed, code = %d.\r\n", ret);
}
led.type = NBIOT_BOOLEAN;
led.flag = NBIOT_READABLE | NBIOT_WRITABLE;
ret = nbiot_resource_add(dev,
3311,
0,
5850,
&led);
if (ret)
{
nbiot_device_destroy(dev);
printf("device add resource(led) failed, code = %d.\r\n", ret);
}
2.平台读取光照、大气压值
3.设备在线