本文作者:sukai

灯具的编程(灯具编程和PLC编程一样吗)

sukai 01-15 116

  /*********************** 数组控制流水灯--配套51单片机开发板********************/

  #include AT89X51.H

  unsigned char code table[]={0xfe,0xfd,0xfb,0xf7,

  0xef,0xdf,0xbf,0x7f,

  0xfe,0xfd,0xfb,0xf7,

  0xef,0xdf,0xbf,0x7f,

  0x7f,0xbf,0xdf,0xef,

  0xf7,0xfb,0xfd,0xfe,

  0x7f,0xbf,0xdf,0xef,

  0xf7,0xfb,0xfd,0xfe,

  0x00,0xff,0x00,0xff,

  0x01};

  unsigned char i;

  void delay(void)

  {

  unsigned char m,n,s;

  for(m=20;m0;m--)

  for(n=20;n0;n--)

  for(s=248;s0;s--);

  }

  void main(void)

  {

  while(1)

  {

  if(table[i]!=0x01)

灯具的编程(灯具编程和PLC编程一样吗)

  {

  P0=table[i];

  i++;

  delay();

  }

  else

  {

  i=0;

  }

  }

  }

  原文链接:https://www.eeworld.com.cn/mcu/article_2016102730923.html

阅读
分享