Poll
Question: What is the easiest programming language to use that can interface with an Arduino?
Visual Basic - 2 (50%)
C# - 2 (50%)
C - 0 (0%)
Total Voters: 4

Pages: [1] 2   Go Down
Author Topic: How to control an Arduino from a PC  (Read 4815 times)
0 Members and 1 Guest are viewing this topic.
California, USA
Offline Offline
Newbie
*
Karma: 0
Posts: 33
I'm a 13 year old that's interested in anything electronic/robotic! My ROBLOX username is 058606.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

First of all, I'm very new to Arduino, so this is probably an easily answered question. What is the easiest/cheapest way to control an Arduino from a PC?
Logged

const bool loveElectronicsRelatedThings = true;

Copenhagen, Denmark
Offline Offline
Edison Member
*
Karma: 33
Posts: 1225
Have you testrun your INO file today?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Via the USB cable.

I suspect you are asking for something else....
Logged

nr Bundaberg, Australia
Online Online
Tesla Member
***
Karma: 129
Posts: 8592
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Write a program in VB/C/C#/whatever that sends commands to the Arduino via the USB.
Write a program on the Arduino that parses these commands.

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 634
Posts: 34532
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

My take on "whatever" is to use a language called Processing, it is free to download and use and remarkably similar to the Arduino code.
Well not so remarkable actually as the Arduino was derived from it.
Logged

UK
Offline Offline
God Member
*****
Karma: 13
Posts: 903
Twitter: @simonmonk2
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@058686 - I translated you.

The message says:

Quote
My Instructables username is RoboGeekDude12!

http://home2.paulschou.net/tools/xlate/
Logged

--
My New Arduino Book: http://www.arduinobook.com

Cumming, GA
Offline Offline
Edison Member
*
Karma: 20
Posts: 1657
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I know this might not seem helpful, but the answer is "You control the Arduino with bi-directional RS232 SERIAL DATA transfers".

So.... any progamming or scripting language that supports RS232 Serial interfacing is how you control the arduino, so as Mike says... work with what you are comfortable with... or try Processing.
Logged

California, USA
Offline Offline
Newbie
*
Karma: 0
Posts: 33
I'm a 13 year old that's interested in anything electronic/robotic! My ROBLOX username is 058606.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You got it right!

@058686 - I translated you.

The message says:

Quote
My Instructables username is RoboGeekDude12!

http://home2.paulschou.net/tools/xlate/
Logged

const bool loveElectronicsRelatedThings = true;

California, USA
Offline Offline
Newbie
*
Karma: 0
Posts: 33
I'm a 13 year old that's interested in anything electronic/robotic! My ROBLOX username is 058606.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, I'm asking for what language to use, and how to make it "tell" the Arduino what to do.

Via the USB cable.

I suspect you are asking for something else....

Logged

const bool loveElectronicsRelatedThings = true;

California, USA
Offline Offline
Newbie
*
Karma: 0
Posts: 33
I'm a 13 year old that's interested in anything electronic/robotic! My ROBLOX username is 058606.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

May I have examples of those programs (Arduino and C#) please?

Write a program in VB/C/C#/whatever that sends commands to the Arduino via the USB.
Write a program on the Arduino that parses these commands.

______
Rob

Logged

const bool loveElectronicsRelatedThings = true;

California, USA
Offline Offline
Newbie
*
Karma: 0
Posts: 33
I'm a 13 year old that's interested in anything electronic/robotic! My ROBLOX username is 058606.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

May I have an example?

My take on "whatever" is to use a language called Processing, it is free to download and use and remarkably similar to the Arduino code.
Well not so remarkable actually as the Arduino was derived from it.
Logged

const bool loveElectronicsRelatedThings = true;

Sweden
Offline Offline
Full Member
***
Karma: 11
Posts: 237
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I tried for a long time to interface my Arduino with C++ but I couldn't find any working library, so now I'm using processing every time I need a custom computer interface.

Jan

P.S. 058606: I'm almost the same age as you are (14, soon 15).

EDIT: http://www.arduino.cc/playground/Main/InterfacingWithSoftware
« Last Edit: January 28, 2011, 03:41:34 pm by JanD » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Actually interfacing depends on your knowledge.
Since Arduino is serial enabled you can send (and receive) serial messages through any serial enabled software on windows. You can use Telnet, Hyper Terminal, Putty and other similar programs to communicate directly with Arduino or you can create your own solution based on any serial enabled development platform. You can even use AutoIt3 to send and receive serial commands from you computer to your hardware.

In my personal opinion if you want to create your own interface for controlling devices the best way to go is Visual Studio (language depends on your experience). Visual Studio examples are plenty now-days so its easy to learn by searching on the web.
 
Logged

Vejen, Denmark
Offline Offline
Edison Member
*
Karma: 9
Posts: 1178
RAWR! ^,..,^
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I am using C# to communicate with my arduino projects. Not sure if it is the easiest way there are, but it is easy for me because I can C#...

How to read serial with C#: http://captain-slow.dk/2010/12/26/read-serial-from-an-arduino/
Logged

captain-slow.dk | non contagious!

nr Bundaberg, Australia
Online Online
Tesla Member
***
Karma: 129
Posts: 8592
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I've used VB.net for this in the past and that's fairly easy. The best example I have is

Code:
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim i As Long
        Dim s As String

        If Not SerialPort1.IsOpen() Then
            SerialPort1.Open()
        End If

        TextBox1.Text = ""
        TextBox1.Refresh()
        Do While i < 50
            SerialPort1.Write("<hello>")
            s = SerialPort1.ReadLine()
            TextBox1.Text = TextBox1.Text + s + vbCrLf
            TextBox1.Refresh()
            i = i + 1
        Loop

    End Sub

    Private Sub Form1_Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Disposed
        If SerialPort1.IsOpen() Then
            SerialPort1.Close()
        End If

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        SerialPort1.PortName = "Com33"
        SerialPort1.Open()
    End Sub
End Class

(I must clean this up one day to just echo characters).

However the simplest thing to do is just use one of the terminal progs mentioned above, or even the IDE serial monitor. That way there's no PC programming to do at all.

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

0
Offline Offline
God Member
*****
Karma: 39
Posts: 988
Get Bitlash: http://bitlash.net
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You might also find it useful to take a look at Bitlash, http://bitlash.net -- Bitlash is a shell language interpreter that runs on the Arduino, and it is easily controlled from the PC side by typing or sending commands through the virtual serial port.  You can store macros in EEPROM to automate small applications.

Download and doc at http://bitlash.net, and some application thoughts on my blog at http://entropymouse.com

Happy hacking,

-br
http://bitlash.net
http://entropymouse.com
Logged

Pages: [1] 2   Go Up
Jump to: