How to send the signals from the PC?

:zipper_mouth_face:
I am trying just to deliver signals from the PC, to be converted into actions by the Arduino. Lets say, to illustrate with an example, that pressing the key “q” the motor rotates to the left…
I used to program like that in BASIC delivering the signals by the parallel port.
I also have experience, in the old days, of connecting the PC with a plotter using the Com1 basic comands…
But I have not seen any way of connecting the PC with the arduino, without using the arduino software, which is OK for delivering the programs, but not to continue the communication.
a) Is someone making a program in Basic or even Excel visual basic… to comunicate with the arduino trough the USB (Com:2 in my case)port?
b) or is any way to facilitate the interface in between the keyboard and the arduino? any examples?
Thanks

This may be enough for your wants...

http://sheepdogguides.com/arduino/art4SeSimpFrmIDE.htm

... and if not, there's...

http://sheepdogguides.com/arduino/art4SeIntro.htm

Have you read the Wiki on communications. Lots of possibilities.

Assuming you have a windows pc

Here you go a simple program in C++ just compile with dev c++

It creats a connection with arduino and sends the char you type, i made for you :smiley: you just need to change the port number :smiley:

#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <dos.h>

FILE *port;
char c; // control char that you will be sending to arduino

main(){

printf("################ config of COM port ################\n\n");
system("mode com7: baud=9600 parity=n data=8 STOP=1 ");// Change 7 to the number of your port

if( (port = fopen(“COM7:”,“r+”)) == NULL ) { //opens port for comunication
printf("\nFailed to open port \n\n\nPress any key to exit…\n");
getchar()
return 1;
}

Sleep(2000); //waits for arduino to reset…
system(“CLS”);// clears screen

while(1){

printf("################ Your project ################\n\n");

printf(“Type control caracter:”);
scanf("%c",&i);

//getchar(); activate this getchar if u get problems… because it might send the “enter” key asweel and skip the next scanf…

fwrite(&i,sizeof(char),1,port);

}
return 0;
}

All done and good to go…

Now on arduino you just have

if serial.available() {

c=serial.read();
if( c==“r” )
the rotates right

and so one …
}

What do you have to install on your Windows PC to be able to do this?

Where do you get the stuff you need?

Thanks!

bloodshev c++ works good thats the one i use, its a c compiler :D you just need to plug in the usb after :D

I know how to program this with linux too, the principle is the same just someof the commands are different aswell as the COM ports name

Or an alternative to C++ is C#, take a look at Visual C# Express which is a great free program for writing and compiling the code.

To find out how to write to the Arduino, take a look at my tutorial here: Communicate with Arduino through C#

I’m sure the Microsoft product IS good… and I’m equally sure that I don’t want to spend the time to become competent with something which may suddenly become available only to paying customers. Nor do I want to support Microsoft’s program of wiping out alternatives and innovation. Sorry… I’ll try NOT to go on about this too many times a year! Only raised those thoughts once before in the past year, if memory serves me.

What I saw in the post earlier in this thread made me thing that the poster was using a non-Microsoft package (as he was), and I was curious to know what it was, so I’d know one of the alternatives the the evil empire! <^_^>

tkbyd:
I’m sure the Microsoft product IS good… and I’m equally sure that I don’t want to spend the time to become competent with something which may suddenly become available only to paying customers. Nor do I want to support Microsoft’s program of wiping out alternatives and innovation. Sorry… I’ll try NOT to go on about this too many times a year! Only raised those thoughts once before in the past year, if memory serves me.

What I saw in the post earlier in this thread made me thing that the poster was using a non-Microsoft package (as he was), and I was curious to know what it was, so I’d know one of the alternatives the the evil empire! <^_^>

I’m sure it won’t suddenly become only available to paying customers, and as for supporting Microsoft, it’s a choice I’d rather not make but choose to for ease of use and access. I do also run Ubuntu on my PC, so that when Windows screws itself and the computer up (which it often does) I can sort everything out.

Personally, though, I like to keep an open mind when it comes to coding languages - I wouldn’t disregard a language or a great piece of software just because it’s written by a company who is out to rip off the computing world, so long as they don’t rip me off in the process!

so long as they don't rip me off in the process!

So you don't mind them having ripped you off in the past then.

I wouldn't disregard a language or a great piece of software just because it's written by a company who is out to rip off the computing world

Trouble is...

When you use the Microsoft product, you DON'T use something else... and it withers and dies. Arduino, Lazarus, KiCad, OpenOffice, etc don't have big marketing departments behind them to convince us to use them. They survive on the strength of their user communities where today's one eyed kings help today's beginners to become tomorrow's one eyed kings. If there aren't people using the products, the wonderful people who do the programming turn to projects where their efforts are appreciated. (And the same applies to the non- MS commercial products, too, of course, but they have an even tougher time. Remember Netscape? Delphi?)

I should point out that I try not to use Microsoft products wherever possible, for example, I don't use Office, I use OpenOffice. I have an Arduino, and love it. I run eclipse for coding Android applications, and I've long since given up on Windows servers as Linux is so much more reliable. The only Microsoft product I do like is Visual Studio, because it means I can make programs with ease - programs that I will happily share the code for and let people edit as much as they like. I think that if Microsoft hadn't become so successful when it did then the computing world would rely on people who are willing to make open source programs, and the world would be a better place for it. The trouble is, Microsoft did become successful and people everywhere stick to what they know, so, as a programmer, I like to make programs that work flawlessly with the OS the majority run. If big computer companies like Dell were to start shipping a Linux package with their computers, I would go and learn Java or Python - but for now, as long as there are people who want my programs, I'm happy.

I used Bloodshed DevC++ and the later definitive WxDevC++ to develop Arduino<->PC interfacing.

They both are very capable, free, and GCC compliant.

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1293046321

Sadly, my hosting company killed my site so the the code referenced is no longer there… (working on fixing that)