Author Topic: Visual Basic components to simulate 7 segment and LEDs?  (Read 1247 times)

0 Members and 1 Guest are viewing this topic.

Offline CraigABTopic starter

  • Contributor
  • Posts: 10
  • Country: au
Visual Basic components to simulate 7 segment and LEDs?
« on: October 01, 2023, 01:08:03 am »
Hi,

Does anyone know of any free Visual Basic (any version) components (OCX, ActiveX, DLL) that can simulate 7 segment displays, LED's and switches?

The only ones that I can find are the paid versions.

Regards,
Craig
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 10385
  • Country: nz
Re: Visual Basic components to simulate 7 segment and LEDs?
« Reply #1 on: October 01, 2023, 02:35:41 am »
Are you looking for something that "looks pretty", or just something usable for teaching.

Writing your own would be pretty easy if all you need to do is draw lines on the canvas to represent whatever segment of the 7-seg is being told to turn on.

There are also many fonts available that show all possible numbers/letters for a 7seg display digit.
So that might be an option.  I've never seen one that shows all possible segment combinations, but one might exist.

Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline CraigABTopic starter

  • Contributor
  • Posts: 10
  • Country: au
Re: Visual Basic components to simulate 7 segment and LEDs?
« Reply #2 on: October 01, 2023, 05:36:51 am »
Cheers mate.

I suppose looking pretty would be nice, but not necessary.

I am not sure where to start to create a component/control that would update like a 7 segment or even an LED. I can probably hack my way through the code side.

Do you have any pointers to creating such a control?

Just so you know, it was a 6809 trainer from Microtec, Ferndale Productions, originally used by Box Hill TAFE in Victoria Australia in the early 1990's that, for the longest time, I wanted to create a simulator for.

Regards,
Craig

 

Online mariush

  • Super Contributor
  • ***
  • Posts: 5171
  • Country: ro
  • .
Re: Visual Basic components to simulate 7 segment and LEDs?
« Reply #3 on: October 01, 2023, 05:45:21 am »
OCX / ActiveX are deprecated technologies, I doubt anyone still supports these in Windows 10 and newer.

Also Visual Basic ... even the .net versions are no longer priority for Microsoft... move on.

 
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 10385
  • Country: nz
Re: Visual Basic components to simulate 7 segment and LEDs?
« Reply #4 on: October 01, 2023, 06:10:42 am »
If it was Delphi I could help, but i know sfa about Visual Basic.

It should be pretty simple though, look up an example on creating a visual component.
Get that working and then modify so it draws lines on the screen from point A to B based on what segment is being requested by the calling method.

It wont look super pretty, but you could improve it by drawing 3 parallel lines with the center one a bit longer at each ends. So the ends look more like a 7 seg. etc..

If that will look good enough really depends on what you need it for.

Another option is to use an existing component that accepts images, or an array of them.
Then you just need to get a big image that has all possible combinations of segments and make a lookup table to copy the right one out of the image
and onto the screen at a specific location.  I dunno about visual studio but Delphi lets you easily copy a subsection of a bigger image onto the screen with a single command.


« Last Edit: October 01, 2023, 06:15:28 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Online mariush

  • Super Contributor
  • ***
  • Posts: 5171
  • Country: ro
  • .
Re: Visual Basic components to simulate 7 segment and LEDs?
« Reply #5 on: October 01, 2023, 06:32:49 am »
You could also fake it out with a font that has the seven segments digits as characters.

Here's a lot of fonts designed for LCD displays : https://www.dafont.com/theme.php?cat=302

You could have an array of labels in VB, one for each digit and the optional dot, if you want to have independent control of colors or other things.

edit : there's such fonts in other sections, just use keywords like led ,segment , dot matrix etc

Here's an example font that's not in the category above, that could work well : https://www.dafont.com/14-segmentled.font

For standalone LEDs and stuff like that, look up on SVG icons and fonts websites, you'll find led icons and shapes that you could convert to bitmaps and just have a few bitmaps for various states of the led (off, on , fade etc )
« Last Edit: October 01, 2023, 07:02:44 am by mariush »
 

Offline CraigABTopic starter

  • Contributor
  • Posts: 10
  • Country: au
Re: Visual Basic components to simulate 7 segment and LEDs?
« Reply #6 on: October 01, 2023, 06:54:24 am »
If it was Delphi I could help, but i know sfa about Visual Basic.

It should be pretty simple though, look up an example on creating a visual component.
Get that working and then modify so it draws lines on the screen from point A to B based on what segment is being requested by the calling method.

It wont look super pretty, but you could improve it by drawing 3 parallel lines with the center one a bit longer at each ends. So the ends look more like a 7 seg. etc..

If that will look good enough really depends on what you need it for.

Another option is to use an existing component that accepts images, or an array of them.
Then you just need to get a big image that has all possible combinations of segments and make a lookup table to copy the right one out of the image
and onto the screen at a specific location.  I dunno about visual studio but Delphi lets you easily copy a subsection of a bigger image onto the screen with a single command.



Thanks mate I appreciate the help.

I'll give it a go.
 

Offline CraigABTopic starter

  • Contributor
  • Posts: 10
  • Country: au
Re: Visual Basic components to simulate 7 segment and LEDs?
« Reply #7 on: October 01, 2023, 06:57:15 am »
You could also fake it out with a font that has the seven segments digits as characters.

Here's a lot of fonts designed for LCD displays : https://www.dafont.com/theme.php?cat=302

You could have an array of labels in VB, one for each digit and the optional dot, if you want to have independent control of colors or other things.

Thank you.

Yea, I know this is dead tech, but that is the stuff I enjoy.

The use of fonts is another interesting idea, thank you.
 

Offline PA0PBZ

  • Super Contributor
  • ***
  • Posts: 5259
  • Country: nl
Re: Visual Basic components to simulate 7 segment and LEDs?
« Reply #8 on: October 01, 2023, 07:58:24 am »
If I google 'vb.net 7 segment display' I get a lot of useful links, including examples like https://www.vbforums.com/showthread.php?877639-How-to-make-7-Segment-led-display-GUI

Keyboard error: Press F1 to continue.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf