MSP430流水灯Ⅰ
#include unsigned char LED; unsigned int table[8] = {BIT0,BIT1,BIT2,BIT3,BIT4,BIT5,BIT6,BIT7}; void main( void ) { // Stop watchdog timer to prevent time out reset WDTCTL = WDTPW + WDTHOLD; LED = 0XFF; P2DIR = 0XFF; P2OUT = LED; while(1) { uns...
#include
unsigned char LED;
unsigned int table[8] = {BIT0,BIT1,BIT2,BIT3,BIT4,BIT5,BIT6,BIT7};
void main( void )
{
// Stop watchdog timer to prevent time out reset
WDTCTL = WDTPW + WDTHOLD;
LED = 0XFF;
P2DIR = 0XFF;
P2OUT = LED;
while(1)
{
unsigned int i,j;
for(i=0;i<8;i++)
{
LED = LED ^table[i];
P2OUT = LED;
LED = 0XFF;
j = 50000;
while(j--);
}
for(i=0;i<8;i++)
{
//LED ^= table[8-i];
LED ^= table[7-i];
P2OUT = LED;
LED = 0XFF;
j = 50000;
while(j--);
}
}
}
【MSP430流水灯Ⅰ】
推荐阅读
- t5灯管价格是多少 t5灯管安装方法
- 客厅水晶灯的安装方法及风水禁忌
- 室内的灯光设计知识要点
- 办公室装修灯光布局常见的3大误区
- 餐厅灯光设计是餐台装修重点
- 餐厅装修之主题餐厅灯光设计
- 轨道射灯模型射灯的轨道通用吗?
- 家装灯具如何挑选家装灯具挑选误区
- 欧帝尔灯具怎么样?欧帝尔灯具有啥类型的灯?
- 过道筒灯改吊灯可以吗吊顶材料?常见的吊顶材料?