挂彩灯怎么挂好看

挂彩灯怎么挂好看,第1张

小彩灯好看的挂法如下:

1、用彩灯拼出心形。

用一串串的彩灯,拼出心形比较简单,但是效果却很好哦。

2、用彩灯缠绕树木,火树银花效果好。

用一种颜色的彩灯沿着树干、树枝缠绕,火树银花不夜天,装饰效果不要太完美。

3、竖着挂,拼出帘状。

一串串的小彩灯竖着挂,组成小帘子,从门外看进去,一种影影绰绰之美。

4、一簇一簇的挂,好像一束束花。

围成一簇一簇的,然后按点状分开来挂,一束束花火,就绽放在室内了。

5、装饰圣诞树(家具)。

将彩灯直接悬挂在家具上边,会让家中立刻喜庆起来。

6、将彩灯横着有些弧度地悬挂。

这种挂法很常规,但是效果很棒哦。

7、选择造型别致的彩灯。

造型别致的彩灯,就是简单地悬挂,效果也会非常好。

1用彩灯拼出心形2用彩灯缠绕树木,火树银花效果好3竖着挂,拼出帘状4一簇一簇的挂,好像一束束花5装饰圣诞树(家具)6将彩灯横着有些弧度地悬挂7选择造型别致的彩灯 1、用彩灯拼出心形。

用一串串的彩灯,拼出心形比较简单,但是效果却很好哦

2、用彩灯缠绕树木,火树银花效果好。

用一种颜色的彩灯沿着树干、树枝缠绕,火树银花不夜天,装饰效果不要太完美!

3、竖着挂,拼出帘状。

一串串的小彩灯竖着挂,组成小帘子,从门外看进去,一种影影绰绰之美。

4、一簇一簇的挂,好像一束束花。

围成一簇一簇的,然后按点状分开来挂,一束束花火,就绽放在室内了。

5、装饰圣诞树(家具)。

将彩灯直接悬挂在家具上边,会让家中立刻喜庆起来!

6、将彩灯横着有些弧度地悬挂。

这种挂法很常规,但是效果很棒哦!

7、选择造型别致的彩灯。

造型别致的彩灯,就是简单地悬挂,效果也会非常好!

你的要求也太高了吧,还是请一个软件工程师给你做啦。我们在网上回答也没有报酬,现在设计个软件也是要很多钱的。

我有个万能跑马灯程序,有10种闪灯样式,其实你只用把灯的摆放顺序打乱也可获得想要的发光样式。

#include <REG52H>

unsigned char RunMode;

void Delay1ms(unsigned int count)

{

unsigned int i,j;

for(i=0;i<count;i++)

for(j=0;j<120;j++);

}

unsigned char code LEDDisplayCode[] = { 0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8, //0~7

0x80,0x90,0x88,0x83,0xC6,0xA1,0x86,0x8E,0xFF};

void Display(unsigned char Value)

{

P3 = LEDDisplayCode[Value];

}

void LEDFlash(unsigned char Count)

{

unsigned char i;

bit Flag;

for(i = 0; i<Count;i++)

{

Flag = !Flag;

if(Flag)

Display(RunMode);

else

Display(0x10);

Delay1ms(100);

}

Display(RunMode);

}

unsigned char GetKey(void)

{

unsigned char KeyTemp,CheckValue,Key = 0x00;

CheckValue = P2&0x32;

if(CheckValue==0x32)

return 0x00;

Delay1ms(10);

KeyTemp = P2&0x32;

if(KeyTemp==CheckValue)

return 0x00;

if(!(CheckValue&0x02))

Key|=0x01;

if(!(CheckValue&0x10))

Key|=0x02;

if(!(CheckValue&0x20))

Key|=0x04;

return Key;

}

unsigned int TimerCount,SystemSpeed,SystemSpeedIndex;

void InitialTimer2(void)

{

T2CON = 0x00; //16 Bit Auto-Reload Mode

TH2 = RCAP2H = 0xFC; //重装值,初始值 TL2 = RCAP2L = 0x18;

ET2=1; //定时器 2 中断允许

TR2 = 1; //定时器 2 启动

EA=1;

}

unsigned int code SpeedCode[]={ 1, 2, 3, 5, 8, 10, 14, 17, 20, 30,

40, 50, 60, 70, 80, 90, 100, 120, 140, 160,

180, 200, 300, 400, 500, 600, 700, 800, 900,1000};//30

void SetSpeed(unsigned char Speed)

{

SystemSpeed =SpeedCode[Speed];

}

void LEDShow(unsigned int LEDStatus)

{

P1 = ~(LEDStatus&0x00FF);

P0 = ~((LEDStatus>>8)&0x00FF);

}

void InitialCPU(void)

{

RunMode = 0x00;

TimerCount = 0;

SystemSpeedIndex = 10;

P1 = 0x00;

P0 = 0x00;

P2 = 0xFF;

P3 = 0x00;

Delay1ms(500);

P1 = 0xFF;

P0 = 0xFF;

P2 = 0xFF;

P3 = 0xFF;

SetSpeed(SystemSpeedIndex);

Display(RunMode);

}

//Mode 0

unsigned int LEDIndex = 0;

bit LEDDirection = 1,LEDFlag = 1;

void Mode_0(void)

{

LEDShow(0x0001<<LEDIndex);

LEDIndex = (LEDIndex+1)%16;

}

//Mode 1

void Mode_1(void)

{

LEDShow(0x8000>>LEDIndex);

LEDIndex = (LEDIndex+1)%16;

}

//Mode 2

void Mode_2(void)

{

if(LEDDirection)

LEDShow(0x0001<<LEDIndex);

else

LEDShow(0x8000>>LEDIndex);

if(LEDIndex==15)

LEDDirection = !LEDDirection;

LEDIndex = (LEDIndex+1)%16;

}

//Mode 3

void Mode_3(void)

{

if(LEDDirection)

LEDShow(~(0x0001<<LEDIndex));

else

LEDShow(~(0x8000>>LEDIndex));

if(LEDIndex==15)

LEDDirection = !LEDDirection;

LEDIndex = (LEDIndex+1)%16;

}

//Mode 4

void Mode_4(void)

{

if(LEDDirection)

{

if(LEDFlag)

LEDShow(0xFFFE<<LEDIndex);

else

LEDShow(~(0x7FFF>>LEDIndex));

}

else

{

if(LEDFlag)

LEDShow(0x7FFF>>LEDIndex);

else

LEDShow(~(0xFFFE<<LEDIndex));

}

if(LEDIndex==15)

{

LEDDirection = !LEDDirection;

if(LEDDirection) LEDFlag = !LEDFlag;

}

LEDIndex = (LEDIndex+1)%16;

}

//Mode 5

void Mode_5(void)

{

if(LEDDirection)

LEDShow(0x000F<<LEDIndex);

else

LEDShow(0xF000>>LEDIndex);

if(LEDIndex==15)

LEDDirection = !LEDDirection;

LEDIndex = (LEDIndex+1)%16;

}

//Mode 6

void Mode_6(void)

{

if(LEDDirection)

LEDShow(~(0x000F<<LEDIndex));

else

LEDShow(~(0xF000>>LEDIndex));

if(LEDIndex==15)

LEDDirection = !LEDDirection;

LEDIndex = (LEDIndex+1)%16;

}

//Mode 7

void Mode_7(void)

{

if(LEDDirection)

LEDShow(0x003F<<LEDIndex);

else

LEDShow(0xFC00>>LEDIndex);

if(LEDIndex==9)

LEDDirection = !LEDDirection;

LEDIndex = (LEDIndex+1)%10;

}

//Mode 8

void Mode_8(void)

{

LEDShow(++LEDIndex);

}

void TimerEventRun(void)

{

if(RunMode==0x00)

{

Mode_0();

}

else if(RunMode ==0x01)

{

Mode_1();

}

else if(RunMode ==0x02)

{

Mode_2();

}

else if(RunMode ==0x03)

{

Mode_3();

}

else if(RunMode ==0x04)

{

Mode_4();

}

else if(RunMode ==0x05)

{

Mode_5();

}

else if(RunMode ==0x06)

{

Mode_6();

}

else if(RunMode ==0x07)

{

Mode_7();

}

else if(RunMode ==0x08)

{

Mode_8();

}

}

void Timer2(void) interrupt 5 using 3

{

TF2 = 0; //中断标志清除( Timer2 必须软件清标志!)

if(++TimerCount>=SystemSpeed)

{

TimerCount = 0;

TimerEventRun();

}

}

unsigned char MusicIndex = 0;

void KeyDispose(unsigned char Key)

{

if(Key&0x01)

{

LEDDirection = 1;

LEDIndex = 0;

LEDFlag = 1;

RunMode = (RunMode+1)%9;

Display(RunMode);

}

if(Key&0x02)

{

if(SystemSpeedIndex>0)

{

--SystemSpeedIndex;

SetSpeed(SystemSpeedIndex);

}

else

{

LEDFlash(6);

}

}

if(Key&0x04)

{

if(SystemSpeedIndex<28)

{

++SystemSpeedIndex;

SetSpeed(SystemSpeedIndex);

}

else

{

LEDFlash(6);

}

}

}

main()

{

unsigned char Key;

InitialCPU();

InitialTimer2();

while(1)

{

Key = GetKey();

if(Key!=0x00)

{

KeyDispose(Key);

}

}

}

一共有三组等,三个定时回路,接通电源的时候,会有一个三极管先导通,这时候这组LED亮起了,导通后集电极的点位会被拉低,这时候电容通过限流电阻开始充电,当电压逐渐升高的时候,下一级三极管导通,这时候另一组LED亮起了,以此类推,这三组灯会轮流按这个顺序点亮,点亮时间是根据电阻和电容的值,电容越大,闪烁越慢,电阻越大闪烁越慢,相反则越快。

unsigned char lights = 0; //lights到各位分别表示P10~P17

int i=0;

while (1)

{

//①L1、L2、…L8依次点亮

lights = 0x01;

for (i=0; i<7; i++)

{

delay(500);

lights = lights << 1;

}

delay(500);

//②L1、L2、…L8依次熄灭

lights = 0xfe;

for (i=0; i<7; i++)

{

delay(500);

lights = (lights << 1) + 0x01;

}

delay(500);

//③L1、L2、…L8全亮

lights = 0xff;

delay(500);

//全灭

lights = 0x00;

delay(500);

}

我 *** ,至少要搞一张高清的啊,看也看不清楚。

51单片机的P0口输出能力非常差,作为输入是对的,相对的程序里面应该对P0口写0x00才能亮的,其他的端口写0xff,另外有几个引脚是用不了的,所以有一个灯点不亮

以上就是关于挂彩灯怎么挂好看全部的内容,包括:挂彩灯怎么挂好看、彩灯怎么挂好看、80c51单片机 彩灯控制器程序等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zz/9877549.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-02
下一篇 2023-05-02

发表评论

登录后才能评论

评论列表(0条)

保存