How to Control a Motor with Visual Basics and a Serial Port?

In summary, to control a motor connected to an electronic chip via a serial port using Visual Basic, you will need a serial-ttl converter. This converter will allow you to send commands through the serial port to control a switch or relay, which will then turn the motor on or off. Some options for this converter include an 'IO-board' or purchasing one from a robotics toy company. The commands used to control the motor may vary, but common ones include "on 1" and "off 1". These commands can be written in a script and run through the serial port. Additionally, homemade commands like 'getInput()', 'setDirection()', and 'setOutput()' can also be used. Once the motor is connected to the circuit
  • #1
darkness_limits
11
0
hi please can anyone tel me how to control a motor connectd to an electronic chip connected to the computer uning serial port , using visual basics(iknow how to use VB )
 
Technology news on Phys.org
  • #2
You cannot connect a motor directly to a serial port
You need to get a serial-ttl converter - available from lots of robotics toy companies.
These will provide a pin that you can drive high or low from the serial port. You can use this to control a switch or relay to turn the motor on or off.
You normally control it by sending text such as "on 1" "off 1" to turn on pin 1 etc.
 
  • #3
In electronics class we use something called an 'IO-board' which is connected through the serial port. Our teacher has written a script to run it and we can use simple commands to write high/Low out throught 8bit.
So we basically use homemade commands like 'getInput()','setDirection()' and 'setOutput()' that does the job.
This is how we do it, and then, as mgb_phys said, we connect the motor etc to a circuit which is controlled by the High/Low from the 8bit.

Hope I was of some help.
 

1. What is Visual Basic?

Visual Basic is a programming language developed by Microsoft. It is primarily used for creating graphical user interfaces (GUIs) and is widely used for developing desktop applications.

2. What are the main features of Visual Basic?

Some of the main features of Visual Basic include a drag-and-drop interface for GUI creation, easy integration with Microsoft Office applications, and a large library of pre-built functions and controls.

3. Is Visual Basic still relevant?

Yes, Visual Basic is still relevant and widely used in the programming world. It is particularly popular for developing Windows applications and is also commonly used in the development of business and financial applications.

4. Can Visual Basic be used for web development?

While Visual Basic was originally intended for desktop application development, it can also be used for web development. However, it is not as widely used for this purpose as other programming languages such as HTML, CSS, and JavaScript.

5. Is Visual Basic easy to learn?

Many people consider Visual Basic to be a relatively easy language to learn, especially for beginners. Its drag-and-drop interface and simple syntax make it a good choice for those who are new to programming.

Similar threads

  • Programming and Computer Science
Replies
11
Views
870
  • Programming and Computer Science
Replies
4
Views
262
Replies
17
Views
642
  • Programming and Computer Science
Replies
2
Views
836
Replies
3
Views
844
  • Programming and Computer Science
Replies
2
Views
2K
Replies
19
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • Programming and Computer Science
Replies
2
Views
3K
Replies
5
Views
3K
Back
Top