Individual LED control VB6

This is the English forum for all topics related to IO-Warrior. Please post in English only

Moderator: Guido Körber

Post Reply
Edwaaaad
Posts: 5
Joined: Fri Mar 17, 2006 9:15 am
Location: Wellington, New Zealand

Individual LED control VB6

Post by Edwaaaad »

Hi there,

I am new to all this, but am trying to get some basic functions out of my IO 40 in VB6. I want to be able to turn individual leds on and off without affecting other ones. This seems to be no problem in the delphi example, but in vb6 there seems to be a number from 0 to 255 for each combination. This is going to be a real pain if I have to code for each possibility ( or learn a new language).

Thanks.
Edwaaaad
Robert Marquardt
Posts: 543
Joined: Mon Dec 01, 2003 6:09 pm

Post by Robert Marquardt »

You have to set and reset bits in a byte. There is no way around it.
That VB6 is not well suited for that is one of the many reasons why i hate VB6.

I am not familiar with the VB6 community, but there should be sample code available for this basic task.
calli
Posts: 37
Joined: Sat Sep 17, 2005 6:35 pm

Post by calli »

Isn't that just a matter of adding the powers of two?

eg for 10001001 = 1+8+128?

Regards,
Carsten
Guido Körber
Site Admin
Posts: 2856
Joined: Tue Nov 25, 2003 10:25 pm
Location: Germany/Berlin
Contact:

Post by Guido Körber »

And of course inverting the value. Low bits mean the port pin gets driven and can power a LED.
Edwaaaad
Posts: 5
Joined: Fri Mar 17, 2006 9:15 am
Location: Wellington, New Zealand

Post by Edwaaaad »

Hey Everyone,

Thanks for your help on this. As I say I am new to this, I downloaded a binary convertor and have used this to accomplish individual control of the LEDS. So thanks for your prompt replies
Post Reply