Selasa, 06 Oktober 2015

get to know voltage and how to measure

Topic : get to know voltage and how to measure

        Voltmeter used measure voltage, ampere meter  used  measure electrical current. measure the electrical resistance use an Ohmmeter. first in the used  voltmeter must be coupled in parallel with the measured potential difference or voltage. Another with ampere meter  installation done by the series. Prepare in advance a series where it will do the measuring. next make sure the voltage of the electrical source types from PLN , switch in the direction of AC (alternating current ). If the source from the battery, (accumulator), or a transformer adaptor, use mode DC (direct current ). Select maximum scale third from voltmeter. In the example there are 10 V, 50 V, 250 and 1000 V for example taken 250 V. Connect the voltmeter to the tool you are going to be measured. the last in the measurements of electrical magnitudes required related with caution, especially with alternating current AC. Error procedure can cause electric sting hit.

Selasa, 29 September 2015

The pride a son to his beloved mother



Topic :  The pride a son to his beloved mother


            My mother is always very good to me and so valuable that sometimes I feel like I have no words to describe her. I have been told by many of my friends that I never really say what I feel, and the reason for this is because it is very hard for me to express my feelings. Every time I am in a situation that I have to express my feelings, I feel like my emotions are caged. The love I have for her is like a rose of eternity, it will never die, but unlike a rose, it will prick not only through my skin, but through my heart and soul. There are even some times when my mother questions if I love her because I hardly ever show her.
           Even though I still haven it really expressed how I feel about my mother, I now have the pleasure to speak my mind. Since I still struggle to express my feelings to her, I decided to describe everything that I love about my precious mother in written words.Every time I see my mother I have the benefit of taking in her beauty. My Mother is light brown eyes are bright and lovely so that the richness of her mind and soul there shines.
          They flash red when right feels wrong to her. These eyes also glow with warmth and tender lights of love. Her abundant black curls fall softly on her beautiful face and feel softly upon my cheeks whenever I hug her. She has loving hands that are so gentle, so kind, so soft that have toiled smoothly through all the years.
        The three great smiles that she has are 1)a radiant smile that spreads such joy and sunshine on all that share her happy heavenly life, 2)a smile that hides the pain of heart and soul, and 3)a smile that lightens life is so bitter trials and brings such calm and peace to heavy hearts. Her beautiful face has shone so pure and tranquil above my head through all my life and dreams. The light brown eyes, the abundant curls, the smiles, the silky smooth skin all blend serenely to form a lovely face.

Minggu, 14 Juni 2015

KOMUNIKASI ETHERNET

Asalammualaikum Wr.Wb

kali ini saya akan membahas tentang KOMUNIKASI ETHERNET

Dasar Teori
 
Komunikasi Ethernet merupakan salah satu jenis komunikasi yang paling sering
ditemui saat ini. Penggunaannya juga beragam, bisa digunakan untuk komunikasi antar
PC, PC dengan mikrokontroller, PC dengan PLC, PLC dengan PLC dan sebagainya.
Komunikasi Ethernet dapat menggunakan media berupa kabel maupun nirkabel.
Media kabel yang digunakan biasanya berupa kabel UTP yang ditiap ujungnya terdapat
konektor RJ45, sedangkan yang nirkabel biasanya memanfaatkan router wireless. Untuk
mengenali tujuan pengiriman data, komunikasi ini menggunakan IP address dan port. IP
Address dianalogikan sebagai kompleks perumahan, dan port dianalogikan sebagai
nomor rumah. Jika IP Address dan port yang digunakan asal-asalan, maka paket data
yang dikirimkan juga tidak akan pernah sampai ke device tujuan.
Pada komunikasi Ethernet terdapat 2 jenis protocol pengiriman data, yaitu TCP dan
UDP. Kedua protocol tersebut memiliki kelebihan dan kekurangan masing-masing. Pada
praktikum kali ini, kita akan membuat sebuah aplikasi chatting teks sederhana
menggunakan protocol UDP.

Tahap pembuatan

1. Buat project baru, kemudian susun form control seperti pada gambar.

2. Tambahkan library berikut ini



        Library tersebut digunakan untuk mengakses thread, socket dan beberapa method
        yang dibutuhkan untuk pembuatan aplikasi.


Selanjutnya Sebelum membuat coding yang harus anda perhatikan ialah merubah name di Textbox dan Button

diganti namenya agar sesuai dengan coding yang ada di bawah ini..

diganti namenya agar sesuai dengan coding yang ada di bawah ini..


3. Salin dan sesuaikan program dibawah ini ke project anda, 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Net;
using System.Net.Sockets;
using System.Threading;

namespace komunikasi_Ethernett
{
    public partial class Form1 : Form
    {
        delegate void AddMessage(string message);
        string userName;
        int port = 11000;
        const string broadcastAddress = "192.168.0.255";
        UdpClient receivingClient = new UdpClient(11000);
        UdpClient sendingClient;
        Thread receivingThread;
        public Form1()
        {
            InitializeComponent();
            this.Load += new EventHandler(Form1_Load);
            btnSend.Click += new EventHandler(button1_Click);
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            btnSend.Focus();
            InitializeSender();
            InitializeReceiver();
        }
        private void InitializeSender()
    {
        sendingClient = new UdpClient(broadcastAddress, port);
        sendingClient.EnableBroadcast = true;
    }
        private void InitializeReceiver()
        {
            ThreadStart start = new ThreadStart(Reciver);
            receivingThread=new Thread(start);
            receivingThread.IsBackground = true;
            receivingThread.Start();
        }
        private void button1_Click(object sender, EventArgs e)
        {
        tbSend.Text = tbSend.Text.TrimEnd();
        if (!string.IsNullOrEmpty(tbSend.Text))
        {
            string toSend = "<" + Environment.MachineName + ">" + tbSend.Text;
            byte[] data = Encoding.ASCII.GetBytes(toSend);
            sendingClient.Send(data,data.Length);
            tbSend.Text="";
        }
        tbSend.Focus();
        }
        private void Reciver()
        {
            IPEndPoint endPoint = new IPEndPoint(IPAddress.Any, port);
            AddMessage messageDelegate = messageReceived;
            while (true)
            {
                byte[] data = receivingClient.Receive(ref endPoint);
                string message = Encoding.ASCII.GetString(data);
                Invoke(messageDelegate, message);
                System.Console.Beep(1500, 300);
            }
        }
        private void messageReceived(string message)
        {
           rtbSend.Text += message + "\n";
        }
    }
}

4. Compile dan jalankan aplikasi.

5. Coba ganti IP address dan port yang digunakan.

6. Compile aplikasi kemudian amati.

Jumat, 29 Mei 2015

Aplikasi yang digunakan untuk menghidupkan danmematikan 3 buah LED

Asalammualaikum Wr.Wb

Selamat datang kembali sahabat mardianto, kali ini saya akan membuat :::::::
Sebuah aplikasi yang digunakan untuk menghidupkan dan
mematikan 3 buah LED yang ada pada Arduino. Pengaturan komunikasi
serial dapat dilakukan langsung pada aplikasi tanpa harus mengubah
program aplikasi.



ini adalah bentuk codingannya yang pertama ::::


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        int a = 0;
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if(a==1)
            {
                button1.Text = "Connect";
                serialPort1.Close();
                a = 0;
                this.Close();
            }
            else
            {
                button1.Text = "Disconnect";
                serialPort1.PortName = comboBox1.Text;
                serialPort1.BaudRate = Convert.ToInt16(comboBox2.Text);
                serialPort1.Open();
                a = 1;
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (button2.Text == "On")
            {
                button2.Text = "Off";
                serialPort1.Write("1");

            }
            else
            {
                button2.Text = "On";
                serialPort1.Write("0");
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            if (button3.Text == "On")
            {
                button3.Text = "Off";
                serialPort1.Write("3");

            }
            else
            {
                button3.Text = "On";
                serialPort1.Write("2");
            }
        }

        private void button4_Click(object sender, EventArgs e)
        {
            if (button4.Text == "On")
            {
                button4.Text = "Off";
                serialPort1.Write("5");

            }
            else
            {
                button4.Text = "On";
                serialPort1.Write("4");
            }
        }
    }
}








dan ini codingan yang ke dua :::

 using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication2
{
    public partial class Form1 : Form
    {
        int a = 0;
        string rx;
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (a == 1)
            {
                button1.Text = "Connect";
                serialPort1.Close();
                a = 0;
                this.Close();
            }
            else
            {
                button1.Text = "Disconnect";
                serialPort1.PortName = comboBox1.Text;
                serialPort1.BaudRate = Convert.ToInt16(comboBox2.Text);
                serialPort1.Open();
                a = 1;
            }
        }

        private void serialPort1_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
        {
          
            rx = serialPort1.ReadExisting();
            this.Invoke(new EventHandler(tampil));
        }
        void tampil(object sender, EventArgs e)
        {
            textBox1.AppendText(rx);
          
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            if (textBox1.Text == "0")
            {
              
                pictureBox1.Image = WindowsFormsApplication2.Resource1.mati;
                textBox1.Clear();
              
            }
            else if (textBox1.Text == "1")
            {
              
                pictureBox1.Image = WindowsFormsApplication2.Resource1.hidup;
                textBox1.Clear();
              
            }
            else if (textBox1.Text == "2")
            {

                pictureBox2.Image = WindowsFormsApplication2.Resource1.mati;
                textBox1.Clear();

            }
            else if (textBox1.Text == "3")
            {

                pictureBox2.Image = WindowsFormsApplication2.Resource1.hidup;
                textBox1.Clear();

            }
            else if (textBox1.Text == "4")
            {

                pictureBox3.Image = WindowsFormsApplication2.Resource1.mati;
                textBox1.Clear();

            }
            else if (textBox1.Text == "5")
            {

                pictureBox3.Image = WindowsFormsApplication2.Resource1.hidup;
                textBox1.Clear();

            }
        }
    }
}


Baiklah untuk lebih tau cara kerja programnya silahkan kunjungi....


https://youtu.be/Hg9t5w6vJ4g