stm32 8位数码管程序c语言,TM1638八位数码管八按键驱动程序(stm32f103驱动,使用了stm32 3.5库)...

这是一个STM32驱动TM1638芯片的程序,该芯片控制一个带有8位数码管和8个按键的板子。程序包括数码管的初始化、数据写入、按键读取等功能,使用了STM32 3.5库。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

**Program Assignment: Driver for TM1638 digital tube

**Author : Wuwang

**Date : 2014.8.26 9:00

**Description : This is a driver for the board which is controled by thechip of tm1638.

The board has eight digital tubes which have eight segments and eight keys.

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

#include "main.h" //#include "stm32f10x.h"

/*********************define and global variables*********************************************/

#define STB GPIO_Pin_0 //chip-select line

#define CLK GPIO_Pin_1 //clock line

#define DIO GPIO_Pin_2 //data line

#define Set(x) GPIO_SetBits(GPIOA,(x))//Sets the selected data port bits

#define Reset(x) GPIO_ResetBits(GPIOA,(x))//Resets the selected data port bits

#define Get(x) GPIO_ReadInputDataBit(GPIOA,(x))==SET //Read the specified input port pin

uint16_t const tm_dat[2][14]={ {'0','1','2','3','4','5',//the char and its segment code

'6','7','8','9','.','-','_',' '},

{0x3F,0x06,0x5B,0x4F,0x66,0x6D,

0x7D,0x07,0x7F,0x6F,0x80,0x40,

0x08,0x00}};

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值