0% found this document useful (0 votes)
53 views1 page

Buatlah Visual Basic Seperti Gambar Di Bawah Ini: Program VB

The document provides code for a Visual Basic program and Arduino program to control an LED. The Visual Basic code uses options and commands to send 'H' or 'M' characters to the Arduino via serial communication. When it receives an 'H', the Arduino code turns on an LED connected to pin 13, and when it receives an 'M' it turns off the LED. The Visual Basic code also changes the color of a shape and text on a label based on the option selected.

Uploaded by

Ahmad Jumadi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views1 page

Buatlah Visual Basic Seperti Gambar Di Bawah Ini: Program VB

The document provides code for a Visual Basic program and Arduino program to control an LED. The Visual Basic code uses options and commands to send 'H' or 'M' characters to the Arduino via serial communication. When it receives an 'H', the Arduino code turns on an LED connected to pin 13, and when it receives an 'M' it turns off the LED. The Visual Basic code also changes the color of a shape and text on a label based on the option selected.

Uploaded by

Ahmad Jumadi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

BUATLAH VISUAL BASIC SEPERTI GAMBAR DI BAWAH INI

PROGRAM VB
Private Sub Command1_Click()
If Option1.Value = True Then
Shape1.BackColor = vbRed
MSComm1.Output = "H"
Label1.Caption = "HIDUP"
Else
Shape1.BackColor = vbWhite
End If
If Option2.Value = True Then
Shape1.FillColor = vbWhite
MSComm1.Output = "M"
Label1.Caption = "MATI"
Else
Shape1.FillColor = vbRed
End If
End Sub
Private Sub Form_Load()
MSComm1.PortOpen = True
End Sub

BUATLAH PROGRAM ARDUINO


/* Simple Project by Giri Wahyu Pambudi
Kontrol LED via Viusal Basic 6
Http:www.cronyos.com */
void setup() {
Serial.begin(9600);
pinMode(13,OUTPUT);
}
char Data;
void loop() {
Data = Serial.read();
if (Data == 'H')
{
digitalWrite(13,HIGH);
}
else if (Data == 'M')
{
digitalWrite(13,LOW);
}
}

You might also like