stuff to do with a USB cord and BASIC programming?

DanFungus

Diamond Member
Jul 27, 2001
5,857
0
0
I just finished ComSc 101, and we did a little BASIC programming in it (first programming I've done other than than html, or chnaging php stuff and Apache stuff). Since I busted my logitech mouse, I have the USB cord that came with it (has the male end for the computer and the other end is where it plugged into the circuit board inside the mouse). What I'm wondering is if anyone has done anything similar to make it do something on the other end of the USB cord...like

make a program with a button in VB, click on the button to "turn on a light" and have a blue LED on the other end of the USB cable that turns on when you do it...is this even possible without like drivers on anything to tell the computer where to send the signal?
blah...just staretd thinking about it
 

zephyrprime

Diamond Member
Feb 18, 2001
7,512
2
81
Problem is visul basic is too high level. It doens't work at the device level at all.

What you could do is get a PIC kit from a electronics store on the web. PICs are a sort of microcontroller family that can be programmed with basic. But this all cost money.
 

Rallispec

Lifer
Jul 26, 2001
12,373
3
81
Originally posted by: zephyrprime
Problem is visul basic is too high level. It doens't work at the device level at all.

What you could do is get a PIC kit from a electronics store on the web. PICs are a sort of microcontroller family that can be programmed with basic. But this all cost money.



thier is no way to do it at all??

i'm sure that if he wanted it bad enough thier is a way.
 

DanFungus

Diamond Member
Jul 27, 2001
5,857
0
0
interesting...would it have to be done in something like assembly? that'd be really neato if it's possible with VB and nothing else required, but, I doubt that it'd be that easy
 

KingNothing

Diamond Member
Apr 6, 2002
7,141
1
0
Code

Found this after a quick search. If this doesn't do what you want, try to find a DLL that exports functions to Windows apps (i.e. VB apps).
 

DanFungus

Diamond Member
Jul 27, 2001
5,857
0
0
Originally posted by: KingNothing
<a class=ftalternatingbarlinklarge href="http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=33181&lngWId=1" target=blank>Code</A>

Found this after a quick search. If this doesn't do what you want, try to find a DLL that exports functions to Windows apps (i.e. VB apps).
woah! thanks!! I'll check it out, and see if I can understand it :eek:
haha, thanks though!

 

DanFungus

Diamond Member
Jul 27, 2001
5,857
0
0
hmm...KingNothing, have you used that? It says that it can control Serial, Parallel, USB, joystick and Infared, but how do I change it.....it comes up as what looks like only Parallel. I'm clueless as to how to use it, and I've stared at the readme, but, still don't get it :confused:
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
run linux and use a serial cable. It's fairly simple to read and write from a serial port.

Not in VB, though.
 

KingNothing

Diamond Member
Apr 6, 2002
7,141
1
0
Apparently the DLL needed by this program isn't included. You can find it here.

In Windows 2000, if you open Device Manager, choose View--Resources by Connection, and look at Input/Output, then the PCI bus, you'll see the various memory addresses of your ports. I'm not sure how this works with USB, you'll have to do some further reading.

He hardcoded the parallel port memory address &H378 in his program. If you want to write to other ports, you'd need to provide a different memory address.