Hi guys,

Today I'll show how you can control a servo with Visual basic. Before this project I’ve never used Visual basic so if anyone finds any mistake in my code please leave a comment here and help me improve it.

you can visit my website for more electronic projects, interesting news and tips:

I've always used the Serial Monitor of the Arduino IDE to communicate with the Arduino, but today we will use a visual basic program that I've created. Basically in the VB program we have 4 buttons that will interact with the Arduino when we press them.

I’ll be showing program in Visual Basic that allows the user to rotate a servo attached to the Arduino. You need to make 3 connections from the servo to your arduino:

   Red: 3.3V (depends on your Servo motor)
   Brown: Ground
   Orange: Digital Pin 9

   Click here to download the VB code
   Click here to download the Arduino Sketch

   When you're using the Visual Basic Program the Serial monitor on the Arduino IDE must be closed
   You need to match the com port on your Visual Basic Code to the right com port you're Arduino is using

I don't know why but youtube cropped my video, the Last two buttons are "Rotate 180º Left" and "Rotate 180º right" . anyway watch it working :)

If you have any questions leave a comment!
<p>here book is available to make some basic cool project with arduino + visual basic 6.0</p><p><a href="http://www.amazon.com/Arduino-Visual-Basic-6-0-software/dp/1511667753" rel="nofollow">http://www.amazon.com/Arduino-Visual-Basic-6-0-software/dp/1511667753</a></p>
<p>Hi i couldnt upload arduino port driver. i'we installed but does not appear in the device manager</p>
<p>Hi,<br>i had tried this with two servos but a problem was found which is the buttons won't work at the same time.<br>any help please?</p>
<p>Hii!, What Visual Basic Do you used in this proyect? </p><p>Because I have a Visual Basic 6 But I can&acute;t see the visual basic code.</p>
<p>Hii!, What Visual Basic Do you used in this proyect? </p><p>Because I have a Visual Basic 6 But I can&acute;t see the visual basic code.</p>
<p>Excellent tutorial. I succeeded in properly running this.</p>
<p>ur stuff is really nice, can u make the vb code for the following video</p><p><iframe allowfullscreen="" frameborder="0" height="281" src="//www.youtube.com/embed/VTTzI3z3jpc" width="500"></iframe></p><p>for my home purpose </p><p>thanx in advance</p>
<p>thanks, but I wish this vid was longer. I'd like an explanation of how VB is interacting with the Arduino, the concept is fascinating. </p>
<p>How to connect VB to Arduino ?</p>
<p>Hi, how can I download the source code for this project?</p><p>The source code link provided does not allow me to download the file.</p><p>Thanks! :)</p>
<p>What's exactly you mean ?</p><p><a href="https://app.box.com/s/2663yu97s9to5i1snw9o" rel="nofollow">https://app.box.com/s/2663yu97s9to5i1snw9o</a></p><p><a href="https://gist.github.com/ruisantos16/4773241" rel="nofollow">https://gist.github.com/ruisantos16/4773241<br><br></a>I've just tried and both links works fine for me :)</p><p>Please try again,</p><p>Rui</p>
<p>Hi thank you for the links. The first one:</p><p><a href="https://app.box.com/s/2663yu97s9to5i1snw9o" rel="nofollow">https://app.box.com/s/2663yu97s9to5i1snw9o</a></p><p>downloads as a internet explorer file which does not allow me to download the code.</p><p>The second one, however, <a href="https://gist.github.com/ruisantos16/4773241" rel="nofollow">https://gist.github.com/ruisantos16/4773241</a></p><p>is good enough, but where's the servo.h file?</p><p>Thanks! :)</p>
<p>Try to download with mozilla or something<br><a href="https://app.box.com/s/2663yu97s9to5i1snw9o" rel="nofollow">https://app.box.com/s/2663yu97s9to5i1snw9o<br><br></a>That file is hosted by box.com. (similar to dropbox, and that folder is shared so anyone can download... try with another browser, because everyone downloaded the code successfully.. :) ).</p><p>the servo.h file is included in the Arduino IDE (1.0+) by default.</p><p>I hope this helps,</p><p>Rui</p>
<p>Hey guy,</p><p>Thank you for all your job, it's really interesting.</p><p>However, I don't really understand some step of the program. For example, why do you differenciate if the angle is under 10 or 100?</p><p>I would like to use your code in order to create a sinusoidal movement, do you think that's possible?</p><p>Thank You,</p><p>BDS29</p>

About This Instructable


56 favorites


Bio: Author, Blogger, Electronics Enthusiast and Entrepreneur. For complete Electronics Projects and Tutorials go to: http://randomnerdtutorials.com/start-here
More by RuiSantos: ESP8266 Web Server (Without Arduino) Arduino Simple Memory Game Arduino – Datalogger with Temperature Sensor and Photoresistor
Add instructable to: