PIC16F785 LED Water Light Program

>#include

__CONFIG(0x33f4);
/ / Watchdog off, reset foot to reset, internal RC oscillation, RA4 / RA5 do I / O

//------------------------------------
/ / delay function
Voiddelay()
{
Inti; / / define the loop variable
For(i=5000;i>0;i--)//cycle number control
{
NOP();// consumes one instruction cycle time
NOP();
}
}

//------------------------------------
/ / initialization function
Voidinit()
{
TRISA=0X00; / / set A port as output
TRISC=0X00; / / set C port as output
TRISB=0X00;
}

//------------------------------------
//Lighting function
voidLED()
{
Chari; / / set the loop variable
While(1)
{
PORTA=1; / / light RA0
For(i=3;i>0;i--)//cycles (RA0-RA2)
{
Delay();
Delay();
Delay();//call 3 times delay function
PORTA=PORTA<<1;//Lights the next LED
}
PORTA=0X10;//Lights RA4
For(i=2;i>0;i--)//2 cycles (RA4-RA5)
{
Delay();
Delay();
Delay();
PORTA=PORTA<<1;
}
PORTA=0;//Clear all displays of port A

PORTB=0X10;//Lights RC0
For(i=4;i>0;i--)//6 cycles (RB0-RB5)
{
Delay();
Delay();
Delay();
PORTB=PORTB<<1;
}
PORTB=0x40; / / clear the display of all RB ports
PORTC=1; / / light RC0
For(i=8;i>0;i--)//6 cycles (RB0-RB5)
{
Delay();
Delay();
Delay();
PORTC=PORTC<<1;
}
PORTC=0; / / clear the display of all RB ports
}
}

//--------------------------------------
/ / Main function
Voidmain()
{
Init();//call initialization function
Led (); / / call the light function
}
PIC16F785 LED Water Light Program

Adapter

Adapter, also called Power Supply , generally, it consists of an outside shell, a power transformer and the circuit etc. According to its output, there are AC adapter, DC adapter and ac dc adapter; According to the connection type, there are wall-mounted adapter and desktop adapter. According to the voltage, there are 12V Adapter and 24V AC Adapter, which are the most common. According to the application, there are laptop replacement ac adapter, Scooter Adapter, Printer Adapter, POE Adapter etc. According to the frequency, there are low frequency Linear Adapter and high frequency charger.

For the adapter, there is a label on it which indicates the input and output etc. Especially for the input, so far, there are two kinds of input voltages, they are 100V~130V and 220V~240V, 110V ~ 130V are classified as low voltage, such as the United States, Japan, etc. their equipments are designed according to such low voltage, focusing on safety; 220V ~ 240V belongs to high voltage, such as China(220V) and Britain(230V), and many European countries, their equipments are designed according to such high voltage, focusing on efficiency. So in order to meet the input needs of different countries, Yidashun designs the 100V~240V for worldwide use.

Yidashun's adapters have below advantages:

1. Worldwide input voltage: 100V~240V

2. High quality and high efficiency

3. Stable output.

4. Low operating temperature and long usage life

5. Good insulation performance.

6. Good anti-interference performance.

Yidashun can customize chargers and power adapters as your requests, OEM & ODM order are welcomed!

laptop adapter,power adapter, ac dc adapter, power supply

laptop adapter,power adapter, ac dc adapter, power supply

printer adapter,laptop adapter,power adapter, ac dc adapter, power supply


AC Adapter,Power Adapter,AC Power Adapter,Replacement AC Adapter

Shenzhen Yidashun Technology Co., Ltd. , https://www.ydsadapter.com

Posted on