多写几行代码而已
sbit WS2812_IO0 = P1^0;
sbit WS2812_IO1 = P1^0;
sbit WS2812_IO2 = P1^0;
void WS2812_SendByte(unsigned char dat,unsigned char dan)
{
unsigned char i = 8;
i <<= 1;
switch(dan)
{
case 0:
{
while (i)
{
WS2812_IO0 = 1;
_nop_();
_nop_();
WS2812_IO0 = CY;
WS2812_IO0 = 0;
dat <<= 1;
i--;
}
break;}
case 1:{}
case 2:{}
default;{}
}
} |