Create an EXE Visual Basic 6.0
To
Control Arduino
Sebarang pertanyaan/pembelian/bantuan boleh dm saya dia twitter eh:
twitter.com/zakimuslim_
Theres have a little bit different between Visual Basic 6.0 and Visual Basic 2008. If you want to learn how to use serial communication and create an EXE in Visual Basic 6.0 here is video that i've make to help you in coding and how to find serial comm component in VB 6.0.
If you still dont have Visual Basic 6.0 software, you can download here for free!!
VB 6.0 Software:
https://drive.google.com/open?id=0B3c_VPBO9Qq3cHROTW5ydkVXOU0
How to find CD key!!
You need to watch on youtube because i've some problem during uploading this video on my blog :(
Tutorial Video!
VIDEO
VB 6.0 tutorial:https://www.youtube.com/watch?v=uoyCcGM9nDA&feature=youtu.be
Arduino Code
You can copy and paste this code or directly download HERE ...Modify this code if needed!
int led = 13;
String incoming;
void setup()
{
Serial.begin(9600);
pinMode(led, OUTPUT);
}
void loop()
{
if(Serial.available() > 0)
{
incoming = Serial.readString();
if(incoming == "Led ON")
{
digitalWrite(led, HIGH);
Serial.println("LED is ON....");
}
else if(incoming == "Led OFF")
{
digitalWrite(led, HIGH);
Serial.println("LED turning OFF.......");
}
}
}
Code Explaination
String incoming;
-string that vb send to arduino.
-string that vb send to arduino.
int led = 13;
-tell arduino i attach led on pin 13
Serial.begin(9600);
-Baud rate. Communication speed between Arduino and PC
pinMode(led, OUTPUT);
pinMode(led, OUTPUT);
-set led as output
if(Serial.available() > 0)
-when serial is available. If Arduino read any byte
incoming = Serial.readString();
-read serial in string.
if(incoming == "TURN ON")
-if incoming string that arduino read is "TURN ON"
digitalWrite(led, HIGH);
-Arduino will turn on led on pin13
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Visual Basic 2008
You also can learn how to use serial comm between Arduino and VB 2008 here. I also post my Arduino basic code to blink a LEDs using VB 2008.
VB 2008 tutorial:
http://ohhmyproject.blogspot.my/2015/09/control-arduino-using-visual-basic-2008.html
Download Link
Arduino Code VB 6.0:https://drive.google.com/open?id=0B3c_VPBO9Qq3VG0yY3hUbldScGc
Visual Basic 6.0 software:
https://drive.google.com/open?id=0B3c_VPBO9Qq3cHROTW5ydkVXOU0
No comments:
Post a Comment