⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 water_fall.lst

📁 source code for waterfall project in hitech c
💻 LST
字号:
     1: #include<pic.h>

     2: void delay(void)

     3: {

     4:         unsigned int i;

     5:         for(i=0;i<=50000;i++);

     6:         {}

     7: }

     8: void main()                             //WDT_ON

     9: {

    10:         unsigned char x,y;

    11:         TRISC=0x00;                     //make PORTC as output

    12:         PORTC=0x01;     

    13:         x=0b00000001;           //0x01

    14:         y=0b01111111;           //0x7f          

    15:         while(1)

    16:         {

    17:         delay();

    18:         x=x<<1;

    19:         PORTC=PORTC|x;

    20:         if(PORTC==0b11111111)

    21:         {

    22:         while(PORTC!=0b00000000)

    23:         {

    24:         delay();

    25:         PORTC=PORTC&y;

    26:         y=y>>1;

    27:         }

    28:         PORTC=0b00000001;

    29:         x=0b00000001;

    30:         y=0b01111111;

    31:         delay();

    32:         }}

    33: }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -