你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

[学习开发日志] 菜鸟试玩 STM32F3 DISCOVERY

[复制链接]
黑溱郎 发布时间:2013-3-15 11:08
阅读主题, 点击返回1楼
收藏 2 评论17 发布时间:2013-3-15 11:08
17个回答
wenze1367 回答时间:2013-5-17 23:08:44

回复:[学习开发日志] 菜鸟试玩 STM32F3 DISCOVERY

<div style="border-bottom: #ccc 1px dashed; border-left: #ccc 1px dashed; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; border-top: #ccc 1px dashed; border-right: #ccc 1px dashed; padding-top: 5px">回复第 4 楼 于2013-03-15 19:38:18发表:
 
四、写主程序:模拟交通灯。

 

主程序如下:

 

/*******************************************************************

 * @file    GPIO_LED/main.c

 * @author HeiTaiLang

 * @version V1.0

 * @date    6-3-2013

 * @brief   Main program body

 *****************************************************************/

/* Includes ------------------------------------------------------------------*/

 

#include "stm32f30x.h"

 

           GPIO_InitTypeDef GPIO_InitStructure;

 

/*******延时函数*******/

 

void Delay(__IO uint32_t nCount)

{

 

 while (nCount != 0)

 {

    nCount--;

 }

}

 

 

void Delay_Ms(__IO uint32_t nCount)

{

 

 while (nCount != 0)

 {

    nCount--; 

    Delay(15000);

 }

}

 

 

int main(void)

{

    uint32_t i;

    /* GPIOE Periph clock enable */

 RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOE, ENABLE);

 

 /* Configure GPIO in output pushpull mode */

 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9 | GPIO_Pin_10 | GPIO_Pin_11 | GPIO_Pin_13 | GPIO_Pin_15;

 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;

 GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;

 GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

 GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;

 GPIO_Init(GPIOE, &GPIO_InitStructure);

   

 while (1)

 {                                

                  GPIO_SetBits(GPIOE,GPIO_Pin_11 | GPIO_Pin_15);    /* 点亮东西向的绿色灯 LD6 and LD7 */

                  Delay_Ms(800);                                       

<div style="text-indent: 10.5pt" align="left"><span style="background: white; color: black; font-size: 9pt">                  for(i=0;i
wenze1367 回答时间:2013-5-17 23:12:50

回复:[学习开发日志] 菜鸟试玩 STM32F3 DISCOVERY

<div style="border-bottom: #ccc 1px dashed; border-left: #ccc 1px dashed; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; border-top: #ccc 1px dashed; border-right: #ccc 1px dashed; padding-top: 5px">回复第 4 楼 于2013-03-15 19:38:18发表:
 
四、写主程序:模拟交通灯。

 

主程序如下:

 

/*******************************************************************

 * @file    GPIO_LED/main.c

 * @author HeiTaiLang

 * @version V1.0

 * @date    6-3-2013

 * @brief   Main program body

 *****************************************************************/

/* Includes ------------------------------------------------------------------*/

 

#include "stm32f30x.h"

 

           GPIO_InitTypeDef GPIO_InitStructure;

 

/*******延时函数*******/

 

void Delay(__IO uint32_t nCount)

{

 

 while (nCount != 0)

 {

    nCount--;

 }

}

 

 

void Delay_Ms(__IO uint32_t nCount)

{

 

 while (nCount != 0)

 {

    nCount--; 

    Delay(15000);

 }

}

 

 

int main(void)

{

    uint32_t i;

    /* GPIOE Periph clock enable */

 RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOE, ENABLE);

 

 /* Configure GPIO in output pushpull mode */

 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9 | GPIO_Pin_10 | GPIO_Pin_11 | GPIO_Pin_13 | GPIO_Pin_15;

 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;

 GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;

 GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

 GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;

 GPIO_Init(GPIOE, &GPIO_InitStructure);

   

 while (1)

 {                                

                  GPIO_SetBits(GPIOE,GPIO_Pin_11 | GPIO_Pin_15);    /* 点亮东西向的绿色灯 LD6 and LD7 */

                  Delay_Ms(800);                                       

<div style="text-indent: 10.5pt" align="left"><span style="background: white; color: black; font-size: 9pt">                  for(i=0;i
honyuan 回答时间:2014-11-11 15:50:17
楼主威武啊,刚接触STM32F3xx还不知道怎么用呢!楼主真帮了我大忙了,谢谢啦
Arhde 回答时间:2014-11-11 17:33:56
很详细,学习了,谢谢
hjl240 回答时间:2014-11-11 18:36:29
很详细,学习学习
lizhiliu 回答时间:2015-7-31 14:18:52
你好,你的程序开不,请更新一个能用的程序,谢谢
baisse-355648 回答时间:2016-5-30 10:20:37
谢谢楼主
甜蜜的药师 回答时间:2017-4-28 08:11:10
刚刚入门 谢谢楼主分享code:)
12

所属标签

STM32团队

意法半导体微控制器和微处理器拥有广泛的产品线,包含低成本的8位单片机和基于ARM® Cortex®-M0、M0+、M3、M4、M33、M7及A7内核并具备丰富外设选择的32位微控制器及微处理器


最新内容

相似分享

官网相关资源

关于
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
意法半导体官网
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
官方最新发布
STM32N6 AI生态系统
STM32MCU,MPU高性能GUI
ST ACEPACK电源模块
意法半导体生物传感器
STM32Cube扩展软件包
关注我们
st-img 微信公众号
st-img 手机版