嵌入式STM32控制电梯面板

嵌入式STM32控制电梯面板

用点阵来显示电梯向上还是向下运动,用数码管来显示楼层数(由于灯阵显示楼层数比较困难故用数码管代替)。当按下对应的按钮,就可以去到对应层数,可上升可下降。

#include "stm32f10x.h"
#include "stm32f10x_exti.h"
#include "stm32f10x_it.h"
#define uint unsigned int
#define KEY1 GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_10) //一楼按钮
#define KEY2 GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_11)//二楼
#define KEY3 GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_12)//三楼
#define KEY4 GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_13)//四楼
#define KEY5 GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_14)//五楼
#define KEY6 GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_15)//六楼
void Delay(void);
void IO_Init(void);
void Smg_Init(void);
void Key_Init(void);
void exit_config(void);
uint b,c,temp,stagepan;
uint stagetemp=1;
uint stage=0;
uint count=1;
uint a=1;
uint arr[]={
   0xffff,0xfe7f,0xfc3f,0xf81f,0xf00f,0xfe7f,0xfe7f,0xfe7f,
            0xfe7f,0xfe7f,0xfe7f,0xfe7f,0xfe7f,0xfe7f,0xfe7f,0xfe7f};  //点阵上升箭头
uint dig[]={
   0xfe7f,0xfe7f,0xfe7f,0xfe7f,0xfe7f,0xfe7f,0xfe7f,0xfe7f,
            0xfe7f,0xfe7f,0xfe7f,0xf00f,0xf81f,0xfc3f,0xfe7f,0xffff};  //点阵下降箭头
uint table[]={
   0x3f,0x06,0x5b,0x4f,0x66,0x6d,
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值