zoukankan      html  css  js  c++  java
  • [KeilC51] 俄罗斯方块流水灯

    Zhouzhi童鞋的作业,大家的思路差不多。。

     1 #include <reg52.h>
     2 
     3 
     4 void delay(unsigned int var){
     5     while(var--);
     6 }
     7 void main(){
     8    char idx1,idx2;
     9    unsigned char temp_P0 ;
    10    unsigned char Onthego ;
    11    unsigned char stack;
    12    temp_P0 = 0x00;
    13    stack = 0x00;
    14    for(idx1=7;idx1>=0;idx1--){
    15            Onthego = 0x01;
    16           for(idx2=0; idx2<=idx1;idx2++){
    17               temp_P0 =  stack;
    18               temp_P0 |= Onthego;
    19               P0 = ~temp_P0;
    20               delay(30000);
    21               Onthego *= 2 ;
    22               if(idx2+1==idx1){
    23                       stack |= Onthego;
    24               }
    25         }
    26     }
    27     while(1);
    28 }
    Code

    Keil & Protues 工程文件:

    https://files.cnblogs.com/alimy/tetris_Led.zip

    ~不再更新,都不让我写公式,博客园太拉胯了
  • 相关阅读:
    Web框架本质及浅谈HTTP协议
    mysql
    jQuery
    Css
    html
    socket编程
    面向对象and类
    模块
    装饰器
    cef network-settings
  • 原文地址:https://www.cnblogs.com/alimy/p/3475286.html
Copyright © 2011-2022 走看看