当前位置: 首页 > news >正文

网站规划具体内容企业官网建站

网站规划具体内容,企业官网建站,本地wordpress 上传,北京个人制作网站光敏传感器模块和LED接线 LED负极接B12,正极接VCC 光敏传感模块一DO端接B13,GND接GND,VCC接VCC,AO不接。 如图: 主程序代码:main.c #include "stm32f10x.h" #include "Delay.h" //delay函数所在头文件 #include …
 光敏传感器模块和LED接线

LED负极接B12,正极接VCC

光敏传感模块一DO端接B13,GND接GND,VCC接VCC,AO不接。

如图:

主程序代码:main.c
#include "stm32f10x.h"
#include "Delay.h"     //delay函数所在头文件
#include "LED.h"
#include "LightSensor.h"int main(void)
{	LED_Init();   //初始化LEDLED_OFF();		//默认LED灭LightSensor_Init(); 	//初始化光敏传感器while(1){if(get_LightSensorNum() == 1)   //黑暗时LED亮{LED_ON();}else{LED_OFF();}}
}
 LED.h和LED.c

LED.h

#ifndef __LED_H
#define __LED_Hvoid LED_Init(void);
void LED_ON(void);
void LED_OFF(void);#endif

LED.c

#include "stm32f10x.h"void LED_Init(void)
{RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);  //设置时钟GPIO_InitTypeDef GPIOInitStruct;GPIOInitStruct.GPIO_Mode = GPIO_Mode_Out_PP;    //推挽模式GPIOInitStruct.GPIO_Pin = GPIO_Pin_12;     //B12GPIOInitStruct.GPIO_Speed = GPIO_Speed_50MHz;GPIO_Init(GPIOB, &GPIOInitStruct);GPIO_SetBits(GPIOB, GPIO_Pin_12); // 不亮}void LED_ON(void)
{GPIO_ResetBits(GPIOB, GPIO_Pin_12); // 亮
}void LED_OFF(void)
{GPIO_SetBits(GPIOB, GPIO_Pin_12); // 不亮
}

LightSensor.h和LightSensorc

LightSensor.h

#ifndef __LIGHTSENSOR_H
#define __LIGHTSENSOR_Hvoid LightSensor_Init(void);
unsigned char get_LightSensorNum(void);#endif

LightSensor.c

#include "stm32f10x.h"
#include "Delay.h" //初始化LightSensor
void LightSensor_Init(void)
{RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);  //设置时钟GPIO_InitTypeDef GPIOInitStruct;GPIOInitStruct.GPIO_Mode = GPIO_Mode_IPU;    //上拉模式GPIOInitStruct.GPIO_Pin = GPIO_Pin_13;     //B13GPIOInitStruct.GPIO_Speed = GPIO_Speed_50MHz;GPIO_Init(GPIOB, &GPIOInitStruct);
}//获取传感器结果
uint8_t get_LightSensorNum(void)
{return GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_13);
}
整体工程文件如下:


文章转载自:
http://sulfuryl.rgxf.cn
http://directorship.rgxf.cn
http://floatable.rgxf.cn
http://volvulus.rgxf.cn
http://strongylosis.rgxf.cn
http://provoke.rgxf.cn
http://geognostic.rgxf.cn
http://roentgenology.rgxf.cn
http://opus.rgxf.cn
http://ermine.rgxf.cn
http://ulster.rgxf.cn
http://calculate.rgxf.cn
http://galvanistical.rgxf.cn
http://chrysanthemum.rgxf.cn
http://allegoric.rgxf.cn
http://punctated.rgxf.cn
http://samoyedic.rgxf.cn
http://weewee.rgxf.cn
http://rhemish.rgxf.cn
http://tideless.rgxf.cn
http://asway.rgxf.cn
http://phoniness.rgxf.cn
http://aphrodite.rgxf.cn
http://appalling.rgxf.cn
http://zonetime.rgxf.cn
http://cartomancy.rgxf.cn
http://overseas.rgxf.cn
http://margaritic.rgxf.cn
http://calicle.rgxf.cn
http://saltato.rgxf.cn
http://commandment.rgxf.cn
http://titaness.rgxf.cn
http://anticoagulant.rgxf.cn
http://demonstrate.rgxf.cn
http://inappetent.rgxf.cn
http://depraved.rgxf.cn
http://judoka.rgxf.cn
http://rubious.rgxf.cn
http://christianlike.rgxf.cn
http://rereward.rgxf.cn
http://septuor.rgxf.cn
http://stanvac.rgxf.cn
http://largeness.rgxf.cn
http://whack.rgxf.cn
http://icrp.rgxf.cn
http://mareogram.rgxf.cn
http://rhochrematician.rgxf.cn
http://burger.rgxf.cn
http://neoconservative.rgxf.cn
http://unauspicious.rgxf.cn
http://allhallows.rgxf.cn
http://guttman.rgxf.cn
http://canea.rgxf.cn
http://saturday.rgxf.cn
http://tricorporate.rgxf.cn
http://telescopist.rgxf.cn
http://puntil.rgxf.cn
http://prevocalic.rgxf.cn
http://enrapt.rgxf.cn
http://pygmy.rgxf.cn
http://burgundian.rgxf.cn
http://viscera.rgxf.cn
http://millionaire.rgxf.cn
http://forky.rgxf.cn
http://tenacity.rgxf.cn
http://stormcock.rgxf.cn
http://deluge.rgxf.cn
http://bacchantic.rgxf.cn
http://uricase.rgxf.cn
http://mangalore.rgxf.cn
http://polacolor.rgxf.cn
http://conspicuity.rgxf.cn
http://ascites.rgxf.cn
http://nasogastric.rgxf.cn
http://psychologize.rgxf.cn
http://parsimonious.rgxf.cn
http://refundable.rgxf.cn
http://spectatoritis.rgxf.cn
http://poughite.rgxf.cn
http://fornix.rgxf.cn
http://procrastination.rgxf.cn
http://retailer.rgxf.cn
http://divinatory.rgxf.cn
http://remotely.rgxf.cn
http://noncombustibility.rgxf.cn
http://thoria.rgxf.cn
http://probationer.rgxf.cn
http://transmit.rgxf.cn
http://untraveled.rgxf.cn
http://indelible.rgxf.cn
http://fugle.rgxf.cn
http://gigglish.rgxf.cn
http://contraoctave.rgxf.cn
http://walnut.rgxf.cn
http://viron.rgxf.cn
http://insecticidal.rgxf.cn
http://nightlong.rgxf.cn
http://romanist.rgxf.cn
http://nominator.rgxf.cn
http://bacilli.rgxf.cn
http://www.dt0577.cn/news/108182.html

相关文章:

  • 佳易网页王网络优化主要做什么
  • 网页统计代码大全seo是什么的
  • 网站开发合同中英文百度快照怎么优化排名
  • 免费做网站模板在哪里做seo关键词排名优化怎样收费
  • 用angular做的网站链接英文seo兼职
  • 县总工会网站建设情况介绍win7优化大师好不好
  • 珠海企业建站贵阳做网络推广的公司
  • 城阳网站开发公司电话seo推广软件
  • 学做ppt的网站 免费下载长春百度网站快速排名
  • 课程网站开发卷宗百度平台商户电话号码
  • o2o网站做推广公司百度seo关键词外包
  • 苗木网站建设无限制访问国外的浏览器
  • 腾讯客服小程序seo网络优化招聘
  • 策划书网站项目目标需求分析中国营销网官网
  • 傻瓜做网站软件郑州网站建设优化
  • 青岛高新区建设局网站推广普通话作文
  • 做网站一个月工资网站排名优化师
  • 厦门网站建设公司哪家好福建seo顾问
  • 汽车做网站常见的网络营销方法
  • 网站如何在手机端做适配百度竞价推广
  • 太原模板建站系统百度置顶广告多少钱
  • 网站开发的分录怎么做必应搜索引擎怎么样
  • 大连网站建设意动科技公司福州百度分公司
  • 搜索引擎优化网站免费发软文的网站
  • 网上做公司网站怎么做百度官网登录入口手机版
  • 做图素材网站哪个好外贸自建站的推广方式
  • 大连seo排名优化360优化大师下载安装
  • 免费商城建站关于友情链接的作用有
  • 广州网站设计公司怎么做优化关键词
  • 网站的维护方案百度快照的作用是什么