热门

最新

红包

立Flag

投票

同城

我的

发布
u011018979
java、iOS、Vue 移动开发领域新星创作者
4 年前
trueu011018979

上线前的必备步骤

程序员写BUG的日常
CSDN App 扫码分享
分享
评论
6
打赏
  • 复制链接
  • 举报
下一条:
救救孩子吧,一道单片机题目:使用74LS165完成并行数据到串行数据的转换,拨码开关控制数码管的显示。例如按下D0,显示0;D1显示1以此类推。啊啊啊要怎么写呀!!!!!!附上我写的代码(菜鸟乱写的)求解答…。    ∧_∧。゚ ゚  (゚ ´Д`゚)っ゚   (つ  /    | (⌒)    し⌒#include <reg52.h>#include <intrins.h>#include <stdio.h>#define uint unsigned int#define uchar unsigned charsbit SPL = P2^5;uchar code DSY_CODE[]={ 0x00,0x3f,0x06,0x5b,0x4f,0x66,0x6d, 0x7d,0x07,0x7f,0x6f };void Delay(uint x){ uchar i; while(x--) { for(i=0;i<120;i++); }}void main(){ uchar temp; SCON = 0x10; while(1) { SPL = 0; SPL = 1; while(RI == 0); RI = 0; temp=~SBUF; P0 = DSY_CODE[temp]; Delay(200); }}
立即登录