1 Ağustos 2010 Pazar

Version:0.9

Version:0.9
StartHTML:0000000105
EndHTML:0000009599
StartFragment:0000001197
EndFragment:0000009583










#include <REGX51.H>

void        bekle()
        {
                unsigned int i;
                for (i=0;i<7600;i++)
                        {
                                ;
                        }
        }


void        Hizi_Arttir()        interrupt 0
        {
                while(!TI);
                SBUF=0xF1;        // Hizi arttir butonuna basilinca aliciya F1H gonder
                bekle();
        }

void        Hizi_Azalt()        interrupt 2
        {
                while(!TI);
                SBUF=0xF2;        // Hizi azalt butonuna basilinca aliciya F2H gonder        
                bekle();
        }

void        main()
        {
                SCON=0x40;        // 8 bit uart modu
                TMOD=0x20;        // Z/S 1 icin 8 bit otomatik yukleme modu
                TH1=0xE8;        // yaklasik 1200 bit/s (11.059 Mhz kristal icin)
                TR1=1;                // Z/S'i calistir
                TI=1;
                EX0=1;                // INT0'in yetkilendirilmesi
                EX1=1;                // INT1'in yetkilendirilmesi
                IT0=1;                // INT0 dusen kenarda tetiklensin
                IT1=1;                // INT1 dusen kenarda tetiklensin
                EA=1;                // Butun kesmelerin yetkilendirilmesi
                P3=0xFF;        //Butonlar giris icin ayarlandi
                while(1)
                        {
                                ;
                        }


        }



PWM sinyali ile DC Motor kontrolü (Visual Basic)
Public Enable As Integer, Phase As Integer, duty_cycle As Integer, a As Integer

Const PortA = &H378 'Paralel Port adresi


Sub delay(delay_time As Double)

'Gecikmeyi sağlayan fonksiyon

temp_timer = Timer

Do

Loop While (Timer - temp_timer) < delay_time

End Sub


Sub pwm(total_time As Double, duty_cycle As Integer)

Dim OnTime As Double

Dim OffTime As Double

OnTime = total_time * duty_cycle / 100

OffTime = total_time - OnTime

Enable = 1

Out PortA, Enable + Phase

delay OnTime

Enable = 0

Out PortA, Enable + Phase

delay OffTime

Label1.Caption = duty_cycle

Label1.Refresh

End Sub


Private Sub Command1_Click()

If duty_cycle < 100 Then

duty_cycle = duty_cycle + 5

Enable = 1

Label1.Caption = duty_cycle

Label1.Refresh

End If

End Sub


Private Sub Command2_Click()

a = 0

Do

DoEvents

If a = 1 Then Exit Do

pwm 0.1, duty_cycle

Loop

End Sub

Private Sub Command3_Click()

If duty_cycle > 5 Then

duty_cycle = duty_cycle - 5

Enable = 1

Label1.Caption = duty_cycle

Label1.Refresh

End If

End Sub


Private Sub Command4_Click()

'Ters yönde çalıştırma rutini

Enable = 1

If Phase = 0 Then

Phase = 2

Else

Phase = 0

End If

End Sub


Private Sub Command5_Click()

'Durdurma ve Do-Loop tan çıkış

a = 1

Out PortA, 0

End Sub


Private Sub Form_Load()

duty_cycle = 50

Phase = 0

End Sub








Hiç yorum yok:

Yorum Gönder

İzleyiciler

LED DİRENÇ HESAPLAMA

All LEDs require current limiting, without a current limiting mechanism the LED will usually burn out in under a second. Adding a simple resistor is the easiest way to limit the current. Use the calculator below to find out the value of resistor you require.

For example if you are wanting to power one of our_blank">red LEDs in an automotive application you would see that the typical forward voltage is 2.0 Volts and the maximum continuous forward current is 30mA. Therefore you would enter 14.5, 2.0 and 30 into the Single LED calculation box. After calculating you get 470ohm 1 watt as the result. Here is a that allows you to enter a resistor value and generate the corresponding color code.

Note: For automotive applications use the actual system voltage, not 12 Volts. Most 12 Volt system actually operate at around 14.5 Volts.

Supply Voltage
VOLTS
Voltage Drop Across LED
VOLTS
Desired LED Current
MILLIAMPS



Calculated Limiting Resistor
OHMS
Nearest higher rated 10% resistor

Calculated Resistor Wattage
WATTS
Safe pick is a resistor with
power rating of (common values are .25W, .5W, and 1W)
WATTS

LEDs in series

Several leds in series with one resistor
Supply Voltage
VOLTS
Voltage Drop Across LED
VOLTS
Desired LED Current
MILLIAMPS
How many LEDs connected




Calculated Limiting Resistor
OHMS
Nearest higher rated 10% resistor

Calculated Resistor Wattage
WATTS
Safe pick is a resistor with
power rating of (common values are .25W, .5W, and 1W)
WATTS
LM317 UYGULAMA DEVRELERİ HESAPLAMASI

 




Çıkış Voltajı
R1 resistor

R2 resistor

R1 resistor
R2 resistor

Çıkış Voltajı


Lm317 uygulama devreleri ve detayli bilgiye Buradan ulasabilirsiniz

LM555 - ASTABLE OSCILLATOR CALCULATOR

LM555 - ASTABLE OSCILLATOR CALCULATOR
Value Of R1 Ohms Value Of R2 Ohms
Value Of C1 Microfarads
Output Time HIGH SECONDS Output Time LOW SECONDS Output Period HIGH + LOW SECONDS Output Frequency HERTZ Output Duty Cycle PERCENT
Resistor values are in Ohms (1K = 1000) - Capacitor values are in Microfarads (1uF = 1)

NOTE: The leakage currents of electrolytic capacitors will affect the actual output results of the timers. To compensate for leakage it is often better to use a higher value capacitor and lower value resistances in the timer circuits.

LM555 Astable Oscillator Circuit Diagram


LM555 - ASTABLE CAPACITOR CALCULATOR

The next calculator can find the capacitance needed for a particular output frequency if the values of R1 and R2 are known.

Value Of R1 Ohms Value Of R2 Ohms
Frequency Desired Hertz
Capacitance uF
s

VOLT AMPER OHM ve WATT HESAPLAMA

Current:
kA (kiloamps) A (amps) mA (milliamps) µA (microamps)
Voltage:
kV (kilovolts) V (volts) mV (millivolts) µV (microvolts)