This document provides instructions for connecting an LED to an Arduino board and controlling it using a Visual Basic program. It describes an Arduino program that turns the LED on or off depending on serial input characters. It also provides the code for a Visual Basic program that sends these characters to control the LED state and displays the status in a text box and shape color.
This document provides instructions for connecting an LED to an Arduino board and controlling it using a Visual Basic program. It describes an Arduino program that turns the LED on or off depending on serial input characters. It also provides the code for a Visual Basic program that sends these characters to control the LED state and displays the status in a text box and shape color.
This document provides instructions for connecting an LED to an Arduino board and controlling it using a Visual Basic program. It describes an Arduino program that turns the LED on or off depending on serial input characters. It also provides the code for a Visual Basic program that sends these characters to control the LED state and displays the status in a text box and shape color.
Here we use Pin 9 as digital output pin connect Led With 9 Number pin of Arduino Board .As shown in breadboard circuit
Step 2: Arduino Program
int led= 9; void setup() { Serial.begin(9600); pinMode(led, OUTPUT); } void loop() { if (Serial.available()) { int drukdata = Serial.read(); if (drukdata=='a') { digitalWrite(led,HIGH); } else if(drukdata=='b') { digitalWrite(led,LOW); }} }
Step 3: Visual Basic 6.0 Program
make form shown in picture
Program for Visual basic 6 (Led on off Control Software) Private Sub EXIT_Click() Form1.Hide End Sub Private Sub Form_Load() MSComm1.RThreshold = 3 MSComm1.Settings = "9600,n,8,1" MSComm1.CommPort = 2 // (Write Port Number on which your Arduino Board is available). MSComm1.PortOpen = True MSComm1.DTREnable = False Text1.Text = "" Shape1.FillColor = vbRed End Sub Private Sub TURNOFF_Click() MSComm1.Output = "b" Text1.Text = "LED IS OFF" Shape1.FillColor = vbRed End Sub Private Sub TURNON_Click() MSComm1.Output = "a" Text1.Text = "LED IS ON" Shape1.FillColor = vbGreen End Sub
Learn Python Programming for Beginners: Best Step-by-Step Guide for Coding with Python, Great for Kids and Adults. Includes Practical Exercises on Data Analysis, Machine Learning and More.
The Advanced Roblox Coding Book: An Unofficial Guide, Updated Edition: Learn How to Script Games, Code Objects and Settings, and Create Your Own World!