• 发文章

  • 发资料

  • 发帖

  • 提问

  • 发视频

创作活动
0
登录后你可以
  • 下载海量资料
  • 学习在线课程
  • 观看技术视频
  • 写文章/发帖/加入社区
返回

电子发烧友 电子发烧友

  • 全文搜索
    • 全文搜索
    • 标题搜索
  • 全部时间
    • 全部时间
    • 1小时内
    • 1天内
    • 1周内
    • 1个月内
  • 默认排序
    • 默认排序
    • 按时间排序
大家还在搜
  • AM2302 - 电子发烧友

    2867次浏览

  • AM2302

    温湿度传感器 3.3~5.5V

    2023-03-24 14:55

  • AM2302温湿度复合传感器的详细中文资料免费下载

    AM2302湿敏电容数字温湿度模块是一款含有己校准数字信号输出的温湿度复合传感器。它应用专用的数字模块采集技术和温湿度传感技术,确保产品具有极高的可靠性与卓越的长期稳定性。传感器包括一个电容式感湿元件和一个高精度测温元件,并与一个高性能8位单片机相连接。

    2018-08-09 08:00

  • 数字温湿度传感器_AM2302

    做智能小车环境监测常用模块电机驱动 温湿度传感器粉尘传感器

    2016-02-23 18:20

  • KL25Z(四) 0.96寸OLED+DHT22(AM2302)

    转这个DHT22与DHT11相比不光是体积大了一圈,而且精度也较之有了提升,价格当然也跟上去了。输出的数据同样是40位,前16位是湿度;随后的16位是温度;最后8位是前面32位的校验和。驱动程序都差不多,这次程序也是在DHT11的基础上修改的。程序还存在一些问题,目前只是有输出而已,采集的数据有些问题需要进一步优化。 下面是主要的代码:static void DHT22_Mode_IPU(void)//使DHT22-DATA引脚变为输入模式{GPIO_InitTypeDef GPIO_InitStruct1;GPIO_InitStruct1.GPIO_Pin = GPIO_Pin_1;GPIO_InitStruct1.GPIO_InitState = Bit_SET;GPIO_InitStruct1.GPIO_IRQMode = GPIO_IT_DISABLE;GPIO_InitStruct1.GPIO_Mode = GPIO_Mode_IN_FLOATING;//设置引脚模式为浮空输入模式GPIO_InitStruct1.GPIOx = PTC;GPIO_Init(&GPIO_InitStruct1);}static void DHT22_Mode_OPP(void)//使DHT22-DATA引脚变为输出模式{GPIO_InitTypeDef GPIO_InitStruct1;GPIO_InitStruct1.GPIO_Pin = GPIO_Pin_1;GPIO_InitStruct1.GPIO_InitState = Bit_SET;GPIO_InitStruct1.GPIO_IRQMode = GPIO_IT_DISABLE;GPIO_InitStruct1.GPIO_Mode = GPIO_Mode_OPP;//设置引脚模式为通用推挽输出GPIO_InitStruct1.GPIOx = PTC;GPIO_Init(&GPIO_InitStruct1);}//复位DHT22void DHT22_Rst(void){DHT22_Mode_OPP();//设置为输出模式DHT22_DATA_OUT(0);DelayMs(20);//主机拉低总线保持18mS以上DHT22_DATA_OUT(1);DelayUs(30);//主机拉高总线30us}//等待DHT22的回应//返回1:未检测到DHT11的存在//返回0:存在uint8_t DHT22_Check(void){uint8_t retry=0;DHT22_Mode_IPU();//主机设为输入 while (DHT22_DATA_IN() && retry=100) return 1;else retry=0; while (!DHT22_DATA_IN() && retry=100) return 1;return 0;}//从DHT22读取一个位//返回值:1/0uint8_t DHT22_Read_Bit(void){uint8_t retry=0;while(DHT22_DATA_IN() && retry

    2016-09-16 17:33

  • 采用AM2302温湿度传感器的二氧化碳监测器设计方案

    硬件部件: ESP32 3.2× 1个 SGP30× 1个 AM2302× 1个 微型USB电缆× 1个 跳线× 1个 面包板× 1个 软件应用程序和在线服务: Arduino IDE 由于疫情

    2021-02-01 14:53

  • 用gpio读AM2302的数据?,程序的问题多多指教

    /* ------------------------------------------ * Copyright (c) 2016, Synopsys, Inc. All rights reserved. * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * 1) Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2) Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation and/or * other materials provided with the distribution. * 3) Neither the name of the Synopsys, Inc., nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * \version 2016.01 * \date 2014-12-17 * \author Wayne Ren(Wei.Ren@synopsys.com)--------------------------------------------- *//** * \defgroupEMBARC_APP_GPIOembARC GPIO Example * \ingroupEMBARC_APPS_TOTAL * \ingroupEMBARC_APPS_BOARD_EMSK * \ingroupEMBARC_APPS_BAREMETAL * \briefembARC Example for testing designware gpio module * * \details * ### Extra Required Tools * * ### Extra Required Peripherals * * ### Design Concept *This example is designed to show how to use device [GPIO HAL API](dev_gpio.h) in embARC. * * ### Usage Manual *Test cases for DW GPIO driver. In this example, the functions of the LEDs, buttons, and DIP switches are tested. *![ScreenShot of gpio under baremetal](pic/images/example/emsk/emsk_gpio.jpg) * * ### Extra Comments * *//** * \file * \ingroupEMBARC_APP_GPIO * \briefexample of timer0 and gpio *//** * \addtogroupEMBARC_APP_GPIO * @{ */#include "embARC.h"#include "embARC_debug.h"static DEV_GPIO_PTR port_th;static void delay(int32_t z){int32_t i,j;for(i=36;i>0;i--)for(j=z;j>0;j--);}staticvoid pushhigh(){uint32_t data0;port_th = gpio_get_dev(DW_GPIO_PORT_A);port_th->gpio_close();port_th->gpio_open(0xB0000);//PORT A的[17:16]、[19]打开port_th->gpio_write(0x30000,0xB0000);//PORT A的[19:16]写入数据,串口总线拉高port_th->gpio_read(&data0,0xB0000);EMBARC_PRINTF("data0 is 0x%x\r\n",data0);}staticvoid pushlow(){uint32_t data1;port_th = gpio_get_dev(DW_GPIO_PORT_A);port_th->gpio_close();port_th->gpio_open(0xB0000);//PORT A的[17:16]、[19]打开port_th->gpio_write(0x10000,0xB0000);//PORT A的[19:16]写入数据,串口总线拉低port_th->gpio_read(&data1,0xB0000);EMBARC_PRINTF("data1 is 0x%x\r\n",data1);}int main(void){uint32_t humity[16];uint32_t temperature[16];long t;DEV_GPIO_BIT_ISR bit_isr;DEV_GPIO_INT_CFG int_cfg;cpu_lock();board_init(); /* board init */while(1){pushhigh();delay(20000);//SDA拉高2spushlow();delay(8);//SDA拉低800uspushhigh();delay(2);//SDA拉高20uspushlow();delay(8);//SDA拉低80uspushhigh();delay(8);//SDA拉高80uspushlow();delay(3);//SDA拉低50uspushhigh();delay(2);//SDA拉高26usport_th->gpio_read(&humity[0],0x20000);//读PORT A的[17]的数据EMBARC_PRINTF("humity[0] is 0x%x%x\r\n",humity[0]);pushlow();delay(3);//SDA拉低50uspushhigh();delay(7);//SDA拉高70usport_th->gpio_read(&humity[1],0x20000);//读PORT A的[17]的数据EMBARC_PRINTF("humity[1] is 0x%x%x\n",humity[1]);port_th->gpio_read(&humity[2],0x20000);//读PORT A的[17]的数据EMBARC_PRINTF("humity[2] is 0x%x%x\n",humity[2]);port_th->gpio_read(&humity[3],0x20000);//读PORT A的[17]的数据EMBARC_PRINTF("humity[3] is 0x%x%x\n",humity[3]);/*port_th->gpio_read(&humity[1],0x20000);//读PORT A的[17]的数据EMBARC_PRINTF("humity is %x\n",humity);//t= ((long)humity[0] >= 3;//conversion (t = t*0,0625) in Degrees //t *= 6250; //EMBARC_PRINTF("t is %2d.%2d\n",t);*/}cpu_unlock(); /* unlock system */while (1);return E_SYS;}

    2016-05-02 16:14

  • MSP430 G2553 单片机 读取 DHT22 AM2302 温湿度传感器 程序

    湿度87%温度25摄氏度

    2021-11-19 19:36

  • MSP430 G2553单片机是怎样读取DHT22 AM2302温湿度传感器程序的

    湿度87%温度25摄氏度

    2021-11-29 08:27

  • 【HAL库每天一例】第073例:OneWire_AM2302(DHT11升级版,性能超好)

    ------------------------------------------------------------------*//************************ AM2302 数据类型定义

    2016-07-23 09:14

  • 【HAL库每天一例】第073例:OneWire_AM2302温湿度数据液晶显示

    \bsp_debug_usart.h"#include "lcd\bsp_lcd.h"#include "stdlib.h"#include "AM2302

    2016-07-25 09:31