2019年10月1日 星期二
四位數_逆時針繞三圈
#include <at89x52.h>
int i;
int anti_cck_i;
void delay_1ms(int k)
{
int i,j;
for(i=0;i<k;i++)
for(j=0;j<110;j++)
;
}
void anti_cck()
{
for(anti_cck_i=0;anti_cck_i<3;anti_cck_i++)
{
P2=0XFE;P1=0XFE;delay_1ms(500);//亮a 個位數
P2=0XFD;P1=0XFE;delay_1ms(500); //亮a十位數
P2=0XFB;P1=0XFE;delay_1ms(500); //亮a百位數
P2=0XF7;P1=0XFE;delay_1ms(500); //亮a千位數
P2=0XF7;P1=0XDF;delay_1ms(500); //亮f千位數
P2=0XF7;P1=0XEF;delay_1ms(500); //亮e千位數
P2=0XF7;P1=0XF7;delay_1ms(500); //亮d千位數
P2=0XFB;P1=0XF7;delay_1ms(500); //亮d百位數
P2=0XFD;P1=0XF7;delay_1ms(500); //亮d十位數
P2=0XFE;P1=0XF7;delay_1ms(500); //亮d個位數
P2=0XFE;P1=0XFB;delay_1ms(500); //亮c個位數
P2=0XFE;P1=0XFD;delay_1ms(500); //亮b個位數
}
P2=0XFE;P1=0XFE;delay_1ms(500); //亮a個位數,因為最後停留在a
}
main()
{
P1=~0xFF;P2=0XFF;
anti_cck();
P1=~0xFF;P2=0XFF;
while(1)
{
;
}
}
訂閱:
張貼留言 (Atom)
algorithm
#include <iostream> #include <string.h> using namespace std; int main(int argc, char** argv) { for(int j=2;j<=100;j++)//j...
-
#include "reg51.h" unsigned char P1table[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80}; int i; sbit dip_sw1=P0^0; void delay_1...
-
setw [C++] 使cout印出格式對齊-setw 設定輸出的欄位長度 85138 0 C/C++ 最近在一些程式,需要用到命令提示字元模式來印出結果,有時候我們會像表格一樣要每一筆資料可能有兩到三個欄位,但這時候,印出時都會因為印出的文字或數字太長而使排版跑掉 但是在...

沒有留言:
張貼留言