SlideShare a Scribd company logo
1 of 7
http://intelegenci.blogspot.com
PROGRAM PARALLEL PORT SEBAGAI SAKLAR DAN INDIKASI MENYALANYA LED
Gambar program baca port
TENTANG PROGRAM :
Ada enam buah komponen penting untuk program Baca port kali ini yaitu :
1. Empat buah textbox yang berwarna merah.
2. Satu buah textbox yang berwarna putih.
3. Timer.
Penjelasan :
1. Textbox yang berwarna merah akan berubah menjadi hijau seiring saklar dipindahkan dari posisi
netral / aktiv rendah ke posisi aktiv tinggi dan sebaliknya.
2. Textbox yang berwarna putih akan menampilkan bilangan desimal yang biasa digunakan untuk
untuk menghidupkan LED pada pin data (378).
3. Timer berfungsi untuk mengulang logika atau syntax perintah yang sudah dimsukkan dengan
interfal waktu tiap per 1 detik.
Catatan :
Ketika kami melakukan uji coba untuk mengakses pin status (379) dan kami mendapatkan
bilangan desimal yang unik ketika tiap kali memindahkan posisi saklar, baik memindahkan saklar satu
persatu maupun bersamaan, bilangan desimal unik ini lah yang akan menjadi penentu posisi LED yang
hidup ketika secara bersamaan saklar dihidupkan.
http://intelegenci.blogspot.com
Berdasarkan jumlahnya saklar ada empat buah dan jika diurut kan menjadi, saklar1, saklar2,
saklar3, saklar4. Dan ketika saklar ini dikombinasikan (pada aktiv tinggi), saklar 1-2, saklar 2-4, hingga
saklar dipindahkan posisinya ke aktif tinggi semua 1-2-3-4 akan memiliki nilai desimal yang berbeda dan
daftar nilai desimal tersebut sudah saya catat. Sebut saja bilangan desimal ini “data in” :
Posisi Saklar ketika
dipindah-pindah
Nilai data in
0 127
1 111
2 95
3 255
4 63
1 & 2 79
1 & 3 239
1 & 4 47
2 & 3 223
2 & 4 31
3 & 4 191
1 & 2 & 3 207
1 & 3 & 4 175
2 & 3 & 4 159
1 & 2 & 4 15
1 & 2 & 3 & 4 143
http://intelegenci.blogspot.com
ALGORITMA PEMROGRAMAN :
ALGORITMA PEMROGRAMAN PORT PARALLEL SEBAGAI SAKLAR
Mulai
Baca port
status (379)
Data
in1
Data
in 2
Data
in 3
Data in
Seterus nya
Hidupkan Led sesuai
data in pin status ke
pin data (378)
http://intelegenci.blogspot.com
SOURCE CODE PROGRAM :
SOURCE CODE PEMROGRAMAN PORT PARALLEL SEBAGAI SAKLAR
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
int data = 0;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
timer.Tick += new EventHandler(timer1_Tick);
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs
e)
{
System.Diagnostics.Process.Start("http://intelegenci.blogspot.com");
}
private void timer1_Tick(object sender, EventArgs e)
{
{
data = Convert.ToInt32(LPT.Input(0x379));
if (data == 111)
{
LPT.Output(0x378, Int32.Parse("1"));
textBox2.Text = "1";
textBox1.BackColor = Color.Green;
textBox3.BackColor = Color.Red;
textBox4.BackColor = Color.Red;
textBox5.BackColor = Color.Red;
}
else if (data == 95)
{
LPT.Output(0x378, Int32.Parse("2"));
http://intelegenci.blogspot.com
textBox2.Text = "2";
textBox1.BackColor = Color.Red;
textBox3.BackColor = Color.Green;
textBox4.BackColor = Color.Red;
textBox5.BackColor = Color.Red;
}
else if (data == 255)
{
LPT.Output(0x378, Int32.Parse("4"));
textBox2.Text = "4";
textBox1.BackColor = Color.Red;
textBox3.BackColor = Color.Red;
textBox4.BackColor = Color.Green;
textBox5.BackColor = Color.Red;
}
else if (data == 63)
{
LPT.Output(0x378, Int32.Parse("8"));
textBox2.Text = "8";
textBox1.BackColor = Color.Red;
textBox3.BackColor = Color.Red;
textBox4.BackColor = Color.Red;
textBox5.BackColor = Color.Green;
}
else if (data == 79)
{
LPT.Output(0x378, Int32.Parse("3"));
textBox2.Text = "3";
textBox1.BackColor = Color.Green;
textBox3.BackColor = Color.Green;
textBox4.BackColor = Color.Red;
textBox5.BackColor = Color.Red;
}
else if (data == 239)
{
LPT.Output(0x378, Int32.Parse("5"));
textBox2.Text = "5";
textBox1.BackColor = Color.Green;
textBox3.BackColor = Color.Red;
textBox4.BackColor = Color.Green;
textBox5.BackColor = Color.Red;
}
else if (data == 47)
{
LPT.Output(0x378, Int32.Parse("9"));
textBox2.Text = "9";
textBox1.BackColor = Color.Green;
textBox3.BackColor = Color.Red;
textBox4.BackColor = Color.Red;
textBox5.BackColor = Color.Green;
}
http://intelegenci.blogspot.com
else if (data == 223)
{
LPT.Output(0x378, Int32.Parse("6"));
textBox2.Text = "6";
textBox1.BackColor = Color.Red;
textBox3.BackColor = Color.Green;
textBox4.BackColor = Color.Green;
textBox5.BackColor = Color.Red;
}
else if (data == 31)
{
LPT.Output(0x378, Int32.Parse("10"));
textBox2.Text = "10";
textBox1.BackColor = Color.Red;
textBox3.BackColor = Color.Green;
textBox4.BackColor = Color.Red;
textBox5.BackColor = Color.Green;
}
else if (data == 191)
{
LPT.Output(0x378, Int32.Parse("12"));
textBox2.Text = "12";
textBox1.BackColor = Color.Red;
textBox3.BackColor = Color.Red;
textBox4.BackColor = Color.Green;
textBox5.BackColor = Color.Green;
}
else if (data == 175)
{
LPT.Output(0x378, Int32.Parse("13"));
textBox2.Text = "13";
textBox1.BackColor = Color.Green;
textBox3.BackColor = Color.Red;
textBox4.BackColor = Color.Green;
textBox5.BackColor = Color.Green;
}
else if (data == 207)
{
LPT.Output(0x378, Int32.Parse("7"));
textBox2.Text = "7";
textBox1.BackColor = Color.Green;
textBox3.BackColor = Color.Green;
textBox4.BackColor = Color.Green;
textBox5.BackColor = Color.Red;
}
else if (data == 159)
{
LPT.Output(0x378, Int32.Parse("14"));
textBox2.Text = "14";
textBox1.BackColor = Color.Red;
textBox3.BackColor = Color.Green;
textBox4.BackColor = Color.Green;
http://intelegenci.blogspot.com
textBox5.BackColor = Color.Green;
}
else if (data == 15)
{
LPT.Output(0x378, Int32.Parse("11"));
textBox2.Text = "11";
textBox1.BackColor = Color.Green;
textBox3.BackColor = Color.Green;
textBox4.BackColor = Color.Red;
textBox5.BackColor = Color.Green;
}
else if (data == 127)
{
LPT.Output(0x378, Int32.Parse("0"));
textBox2.Text = "0";
textBox1.BackColor = Color.Red;
textBox3.BackColor = Color.Red;
textBox4.BackColor = Color.Red;
textBox5.BackColor = Color.Red;
}
else if (data == 143)
{
LPT.Output(0x378, Int32.Parse("15"));
textBox2.Text = "15";
textBox1.BackColor = Color.Green;
textBox3.BackColor = Color.Green;
textBox4.BackColor = Color.Green;
textBox5.BackColor = Color.Green;
}
}
}
}
}

More Related Content

Featured

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Featured (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

Program parallel port sebagai saklar dan indikasi menyala nya led

  • 1. http://intelegenci.blogspot.com PROGRAM PARALLEL PORT SEBAGAI SAKLAR DAN INDIKASI MENYALANYA LED Gambar program baca port TENTANG PROGRAM : Ada enam buah komponen penting untuk program Baca port kali ini yaitu : 1. Empat buah textbox yang berwarna merah. 2. Satu buah textbox yang berwarna putih. 3. Timer. Penjelasan : 1. Textbox yang berwarna merah akan berubah menjadi hijau seiring saklar dipindahkan dari posisi netral / aktiv rendah ke posisi aktiv tinggi dan sebaliknya. 2. Textbox yang berwarna putih akan menampilkan bilangan desimal yang biasa digunakan untuk untuk menghidupkan LED pada pin data (378). 3. Timer berfungsi untuk mengulang logika atau syntax perintah yang sudah dimsukkan dengan interfal waktu tiap per 1 detik. Catatan : Ketika kami melakukan uji coba untuk mengakses pin status (379) dan kami mendapatkan bilangan desimal yang unik ketika tiap kali memindahkan posisi saklar, baik memindahkan saklar satu persatu maupun bersamaan, bilangan desimal unik ini lah yang akan menjadi penentu posisi LED yang hidup ketika secara bersamaan saklar dihidupkan.
  • 2. http://intelegenci.blogspot.com Berdasarkan jumlahnya saklar ada empat buah dan jika diurut kan menjadi, saklar1, saklar2, saklar3, saklar4. Dan ketika saklar ini dikombinasikan (pada aktiv tinggi), saklar 1-2, saklar 2-4, hingga saklar dipindahkan posisinya ke aktif tinggi semua 1-2-3-4 akan memiliki nilai desimal yang berbeda dan daftar nilai desimal tersebut sudah saya catat. Sebut saja bilangan desimal ini “data in” : Posisi Saklar ketika dipindah-pindah Nilai data in 0 127 1 111 2 95 3 255 4 63 1 & 2 79 1 & 3 239 1 & 4 47 2 & 3 223 2 & 4 31 3 & 4 191 1 & 2 & 3 207 1 & 3 & 4 175 2 & 3 & 4 159 1 & 2 & 4 15 1 & 2 & 3 & 4 143
  • 3. http://intelegenci.blogspot.com ALGORITMA PEMROGRAMAN : ALGORITMA PEMROGRAMAN PORT PARALLEL SEBAGAI SAKLAR Mulai Baca port status (379) Data in1 Data in 2 Data in 3 Data in Seterus nya Hidupkan Led sesuai data in pin status ke pin data (378)
  • 4. http://intelegenci.blogspot.com SOURCE CODE PROGRAM : SOURCE CODE PEMROGRAMAN PORT PARALLEL SEBAGAI SAKLAR using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { int data = 0; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer(); timer.Tick += new EventHandler(timer1_Tick); } private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { System.Diagnostics.Process.Start("http://intelegenci.blogspot.com"); } private void timer1_Tick(object sender, EventArgs e) { { data = Convert.ToInt32(LPT.Input(0x379)); if (data == 111) { LPT.Output(0x378, Int32.Parse("1")); textBox2.Text = "1"; textBox1.BackColor = Color.Green; textBox3.BackColor = Color.Red; textBox4.BackColor = Color.Red; textBox5.BackColor = Color.Red; } else if (data == 95) { LPT.Output(0x378, Int32.Parse("2"));
  • 5. http://intelegenci.blogspot.com textBox2.Text = "2"; textBox1.BackColor = Color.Red; textBox3.BackColor = Color.Green; textBox4.BackColor = Color.Red; textBox5.BackColor = Color.Red; } else if (data == 255) { LPT.Output(0x378, Int32.Parse("4")); textBox2.Text = "4"; textBox1.BackColor = Color.Red; textBox3.BackColor = Color.Red; textBox4.BackColor = Color.Green; textBox5.BackColor = Color.Red; } else if (data == 63) { LPT.Output(0x378, Int32.Parse("8")); textBox2.Text = "8"; textBox1.BackColor = Color.Red; textBox3.BackColor = Color.Red; textBox4.BackColor = Color.Red; textBox5.BackColor = Color.Green; } else if (data == 79) { LPT.Output(0x378, Int32.Parse("3")); textBox2.Text = "3"; textBox1.BackColor = Color.Green; textBox3.BackColor = Color.Green; textBox4.BackColor = Color.Red; textBox5.BackColor = Color.Red; } else if (data == 239) { LPT.Output(0x378, Int32.Parse("5")); textBox2.Text = "5"; textBox1.BackColor = Color.Green; textBox3.BackColor = Color.Red; textBox4.BackColor = Color.Green; textBox5.BackColor = Color.Red; } else if (data == 47) { LPT.Output(0x378, Int32.Parse("9")); textBox2.Text = "9"; textBox1.BackColor = Color.Green; textBox3.BackColor = Color.Red; textBox4.BackColor = Color.Red; textBox5.BackColor = Color.Green; }
  • 6. http://intelegenci.blogspot.com else if (data == 223) { LPT.Output(0x378, Int32.Parse("6")); textBox2.Text = "6"; textBox1.BackColor = Color.Red; textBox3.BackColor = Color.Green; textBox4.BackColor = Color.Green; textBox5.BackColor = Color.Red; } else if (data == 31) { LPT.Output(0x378, Int32.Parse("10")); textBox2.Text = "10"; textBox1.BackColor = Color.Red; textBox3.BackColor = Color.Green; textBox4.BackColor = Color.Red; textBox5.BackColor = Color.Green; } else if (data == 191) { LPT.Output(0x378, Int32.Parse("12")); textBox2.Text = "12"; textBox1.BackColor = Color.Red; textBox3.BackColor = Color.Red; textBox4.BackColor = Color.Green; textBox5.BackColor = Color.Green; } else if (data == 175) { LPT.Output(0x378, Int32.Parse("13")); textBox2.Text = "13"; textBox1.BackColor = Color.Green; textBox3.BackColor = Color.Red; textBox4.BackColor = Color.Green; textBox5.BackColor = Color.Green; } else if (data == 207) { LPT.Output(0x378, Int32.Parse("7")); textBox2.Text = "7"; textBox1.BackColor = Color.Green; textBox3.BackColor = Color.Green; textBox4.BackColor = Color.Green; textBox5.BackColor = Color.Red; } else if (data == 159) { LPT.Output(0x378, Int32.Parse("14")); textBox2.Text = "14"; textBox1.BackColor = Color.Red; textBox3.BackColor = Color.Green; textBox4.BackColor = Color.Green;
  • 7. http://intelegenci.blogspot.com textBox5.BackColor = Color.Green; } else if (data == 15) { LPT.Output(0x378, Int32.Parse("11")); textBox2.Text = "11"; textBox1.BackColor = Color.Green; textBox3.BackColor = Color.Green; textBox4.BackColor = Color.Red; textBox5.BackColor = Color.Green; } else if (data == 127) { LPT.Output(0x378, Int32.Parse("0")); textBox2.Text = "0"; textBox1.BackColor = Color.Red; textBox3.BackColor = Color.Red; textBox4.BackColor = Color.Red; textBox5.BackColor = Color.Red; } else if (data == 143) { LPT.Output(0x378, Int32.Parse("15")); textBox2.Text = "15"; textBox1.BackColor = Color.Green; textBox3.BackColor = Color.Green; textBox4.BackColor = Color.Green; textBox5.BackColor = Color.Green; } } } } }