zhou2008 发表于 2023-4-1 21:41:30

新人报道,STC8G1K08A点灯

本帖最后由 zhou2008 于 2023-4-1 21:42 编辑

#include <REG52.h>
#include <INTRINS.h>

void Delay(unsigned int ms)      //@24.000MHz
{
    unsigned char i, j;

    while (ms)
    {
      _nop_();
      i = 32;
      j = 40;
      do
      {
            while (--j);
      } while (--i);
      ms--;
    }
}

void main()
{
    while (1)
    {
      RXD = 0;
      TXD = 1;
      Delay(500);
      RXD = 1;
      TXD = 0;
      Delay(500);
    }
}
(发不了视频只能发gif)
虽然只有单个芯片,但是不影响点串口模块上的灯
页: [1]
查看完整版本: 新人报道,STC8G1K08A点灯