PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
Grade 11 vb.net-VBForums
Results 1 to 19 of 19

Thread: Grade 11 vb.net

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2018
    Posts
    11

    Post Grade 11 vb.net

    Hello, I am brand new to Vb.Net and my grade 11 class is using VB.net for the summative( final performance task), i was not hear for the grade 10 course when they learned vb so now I am stuck.. I need to make a small game, and connect it to vb.net using a parrarel port and write code and control the game. It is a simple game like a small rc car with buttons( No joysticks) just on/off like buttons, press up to go up press down to go down etc. I am having trouble since I am brand new to coding and in need of major help, also I am not sure which vb the teacher is using, im pretty sure its a old one maybe 2002, but i do know that he has modified it a bit. I will be needing some help on this any any ideas would be highly appreciated. I was originally thinking of controlling a hexbug like this

    https://www.amazon.ca/Hexbug-451-165...=hexbug+spider

    but i was thinking of making a pinball machine using motors maybe but that kinda seems hard. so I found another thing similar to the hexbug a small rc car. https://secure.sayal.com/images_c/2311-JA1.JPG
    the transmitter will have to have buttons like that, no joysticks. I will have to connect the transmitter to vb.net using parrarel port.

    Sorry for the long post but I am in need of major help. Teacher is strict and is not helpful. students do not like him because of his attitude towards students. Please help!
    Thank you

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    32,505

    Re: Grade 11 vb.net

    Are you sure you are really using a parallel port? I haven't seen one of those on a computer in over a decade...except some old ones I have here and there. If you really are using a parallel port, that could be an issue, as knowledge about that is fading.

    Knowing something about which version of VB is pretty important, too, but that should be fairly easy to figure out. It should be in Help | About for VS. Perhaps more important would be the framework that is being targeted, but if the version of VB is as old as you say, then you won't have any choice about that. You only started to get to target different frameworks in more recent versions.

    Also, how much time do you have? There are good resources on line, including this site, but if you are just starting out, a tutorial like http://www.homeandlearn.co.uk/NET/vbNet.html may be a better place to start.
    My usual boring signature: Nothing

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2018
    Posts
    11

    Re: Grade 11 vb.net

    Hey, thank you for the reply. Yea it is a parrarel port but I will make sure again tomorrow. They are using pretty old equipment in our tech class though so yea. Most of the equpiment is pretty old and was bought when he first came here which was about 8 years ago i think and are still in use. Also They arent very complex, the grade 11 ones or atleast im not going into a complex one hopefully. I can share a few pcitures or give you the site link to past student works, but teacher is very strict and rude to students. always grumpy. http://laxton.ca/Student_Work.htm. Make sure you are looking at the grade 11 course because thats what Il be doing. But sadly I was not here last year when they did Vb.net so I am now stuck. Thank you for replying highly appreciated.

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    100,050

    Re: Grade 11 vb.net

    It's more likely a serial port than a parallel port. Personally, I've never seen a parallel port used for anything other than connecting a printer. Presumably they were used for other things originally but, as long as I've been using computers, I've never seen anything else. The .NET Framework includes a SerialPort class, so they are not too hard to work with. There's nothing that relates specifically to parallel ports though.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5
    Fanatic Member
    Join Date
    Aug 2004
    Location
    Essex, UK
    Posts
    552

    Re: Grade 11 vb.net

    You can use the parallel port for IO, at least up to Windows 7 64-bit but I haven't tried it on anything later. My tests suggest you need a "genuine" on-board parallel port and not an add-on card and certainly not a USB to parallel converter. The problem is that few modern motherboards have on-board parallel ports. Perhaps this is a good use for an old XP machine that would otherwise be junk. If you target .net 4.5 the software will run on XP SP3.

    EDIT: I think I should have said .NET 4.0 not 4.5.
    Last edited by paulg4ije; Jan 9th, 2018 at 08:52 AM.

  6. #6
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    32,505

    Re: Grade 11 vb.net

    I remember a thread on parallel port programming in here for MANY years ago. Few people knew anything about it, and it was dealing with some REALLY obscure stuff.

    Basically, if you are really doing parallel port stuff, you exclude most people. Like JMC, I've never seen the parallel port used for anything other than printers. Because of that old thread, I do know that some people do use it...but it is so rare that people with experience in that are few and far between. Serial port is FAR more common, though about as old. If you are lucky, you are wrong about it being parallel port, cause that would be terrible.
    My usual boring signature: Nothing

  7. #7
    You don't want to know.
    Join Date
    Aug 2010
    Posts
    4,580

    Re: Grade 11 vb.net

    Looking at the pictures, my guessed scale makes those cable connectors way too wide to be serial. It's not impossible to talk to a parallel port with VB .NET. I've seen a The Code Project article about it. It's just a little archaic because as has been done to death in this thread, the ubiquity of USB makes parallel and even serial ports "an extra cost" that 99% of consumers don't need, so most people just don't have them. Parallel died out faster than serial because of the ubiquity of serial for random bits of hardware, I guess. I never saw parallel used for much besides printers and scanners.

    Anyway, browsing around for The Code Project articles makes it look kind of dire from my end. Every article is using some third-party DLL to talk to the port. That implies if there's Windows API for interfacing with a parallel port, it's very gnarly and no one wants to write tutorials about using it directly. I'm also worried because almost all of the articles are very old, the newest is from 2013 and uses a different DLL from the rest.

    Anyway again. I keep getting diverted.

    Because there's no well-established standard way to talk to a parallel port from .NET, none of us can start answering questions yet. Presumably if your professor is teaching a class about doing this, he's provided some library and documentation for accessing the parallel port. We can't answer many useful questions without that documentation. (And I sure as heck can't test it because I don't have any machines with a parallel port, let alone devices.)

    After that, details about how to accomplish any random thing will depend on the documentation of whatever device you are controlling.

    You didn't really ask any questions, so it's hard for me to come up with more of an answer. It sounds to me like what you're saying is "I'm in a 2nd level class but for whatever reason didn't take the 1st level class and I'm lost". To me, the best answer is to raise this to the professor and get yourself into the 1st level class. The next-best would be to look at tutorials like the one linked in #2 and, preferably, buy some introductory programming books about VB and commit to spending the next couple of weeks doing not much else but reading them.

    Programming is a series of tasks that build on each other, much like progressions of mathematics topics. "I'm in a 2nd level class without 1st level knowledge" is sort of like saying, "I"m taking trigonometry before I have taken algebra." It is possible to learn them in parallel, but much harder. Generally we shouldn't do things that are this hard if we can avoid them.

    So while I could make some suggestions on how your life might be easier talking to a random parallel I/O library, most of that advice will be useless to you if you aren't already comfortable with writing small programs with only casual glances at documentation or class notes. This is much like how it's difficult to explain trigonometry if I can't assume you know things like "the transitive property" or "the reflexive property".
    This answer is wrong. You should be using TableAdapter and Dictionaries instead.

  8. #8

    Thread Starter
    New Member
    Join Date
    Jan 2018
    Posts
    11

    Re: Grade 11 vb.net

    thanks for all the replies guys, I just checked today and it is a parallel port. It still uses windows XP like you guys said. the computers are pretty old. I have decided to make a simple pinball machine using 2 motors, dont know exactly which two motors though. Also I am not sure If I will have to use a breadboard along with parrarel port. We are starting tomorrow and will need help with the coding. http://laxton.ca/Student_Work.htm go to the website and look at the pinball game, You can come up with your own game but I decided to the pinball, It will be similar to this and Hope this is a good example. ( 7th picture from the top)

    PS : last years classes got to work with another person but this year we cant so I cant share anything with people since everyone is trying to do different toys or games..

  9. #9

    Thread Starter
    New Member
    Join Date
    Jan 2018
    Posts
    11

    Re: Grade 11 vb.net

    Yea I was not here in grade 10 when they started learning Vb and Since grade 11 is a senior year, I decided to go to the computer side. I like it but the teacher is not very helpful. Basicly everyone in the school told me not to take him but hes the only electrical engineering teacher so thers no choice.

  10. #10

    Thread Starter
    New Member
    Join Date
    Jan 2018
    Posts
    11

    Re: Grade 11 vb.net

    Hey guys, We started our project today, We are using a parallel port. I think a DB25 parallel port. Also about the VB.net, we are using ( Microsoft visual basic 2010 express) Windowx xp is the os. Hope this info made things a bit more clearer. I am at the moment having trouble on how to use the left and right arrow keys to work so that I do not have to click on the buttons with the mouse. right now in my form, I have 2 buttons labeled left arrow key and right arrow key and a textbox which displays which button I clicked. But I need to have it so that the arrow keys will work instead of clicking the buttons

  11. #11
    Hyperactive Member
    Join Date
    Nov 2017
    Posts
    409

    Re: Grade 11 vb.net

    Make sure the Form's KeyPreview property is set to True, then you can respond to events like KeyPress, KeyDown at the form level.

    If you use KeyDown, then inside that Event you can do something like:

    Code:
    Select Case e.KeyCode
      Case Keys.Up
        ' Respond to up key pressed
      Case Keys.Right
        ' Respond to right key pressed
      Case Keys.Down
        ' Respond to down key pressed
      Case Keys.Left
        ' Respond to left key pressed
    End Select
    Last edited by OptionBase1; Jan 10th, 2018 at 07:17 PM.

  12. #12

    Thread Starter
    New Member
    Join Date
    Jan 2018
    Posts
    11

    Re: Grade 11 vb.net

    thank you, I will try that. bad thing is I have to wait to go back to school. we cant work on it at home. I can only practice but I dont have vb.net. Is there anyway I can get it for free or even a trial? for the 2010 one. also what language does it use? I am not sure

  13. #13
    Hyperactive Member
    Join Date
    Nov 2017
    Posts
    409

    Re: Grade 11 vb.net

    The Visual Studio 2010 Express file doesn't seem to be available to download directly from Microsoft any longer, but someone else just asked within the past couple days on where they could download it from, and I found that it was available to download from the Wayback machine at archive.org. Here is the link to the .iso file.

    https://web.archive.org/web/20111016...10Express1.iso

  14. #14

    Thread Starter
    New Member
    Join Date
    Jan 2018
    Posts
    11

    Re: Grade 11 vb.net

    Guys, I got Vb.Net on my computer. I got some of the code to work. i got in a bad injury. fell on ice so i am now catching up on 3 days of school. I'm working on vb and had some code but the teacher said it wont work and will need a override key code. I got the code for a key press event but i don't know how to disable it.. I am thinking of using a delay code but not sure how to do that or the code for it. I have it set to my a key as of now but when i press it it stays activated doesn't deactivate when i let go. Is there a override key code for key up and key down events? that's how i had it before without the override part

  15. #15

    Thread Starter
    New Member
    Join Date
    Jan 2018
    Posts
    11

    Re: Grade 11 vb.net

    Hey thanks, im not sure if this will work though. Apparently i need a override key code man right now i have it at key press event but dont know how to deactivate it.. it doesn't deactivate it like it did before with the key down and key up event. like for example, when i let go of the A button it doesnt deactivate. stays activated

  16. #16

    Thread Starter
    New Member
    Join Date
    Jan 2018
    Posts
    11

    Re: Grade 11 vb.net

    hi thanks man, My teacher gave me VB so i got it on my pc. thanks fore the reply though. highly appreciated

  17. #17

    Thread Starter
    New Member
    Join Date
    Jan 2018
    Posts
    11

    Re: Grade 11 vb.net

    shaggy hiker, do you know how to use over ride codes for the key up and down events man? If not do you know how to deactivate a overide code im thinking about using a delay code but no idea how to

  18. #18
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    100,050

    Re: Grade 11 vb.net

    It's hard to know exactly what you mean when you talk about overrides. I assume that you're talking about overriding a method. If done properly, each event will have a method dedicated to raising it. When you're inside the class (or a derived class) that declared the event, you have the choice of either handling the event or overriding the method that raises it. Any form that you add to your project is derived from the Form class, so you have the choice of handling the forms events or overriding the methods that raise those events. In the case of a form, most people handle the events because it's convenient to do so and it makes logical sense given the scenario. In most cases though, you should override the method. Here are examples of how the two options would be implemented for the load event of a form:
    vb.net Code:
    1. Public Class Form1
    2.  
    3.     Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    4.         'your code here
    5.     End Sub
    6.  
    7. End Class
    vb.net Code:
    1. Public Class Form1
    2.  
    3.     Protected Overrides Sub OnLoad(e As EventArgs)
    4.         MyBase.OnLoad(e)
    5.  
    6.         'your code here
    7.     End Sub
    8.  
    9. End Class
    You can do basically the same for any event.

    If you'd like to learn more about the relationship between the event and the method, follow the Blog link in my signature below and check out my post on Custom Events.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  19. #19

    Thread Starter
    New Member
    Join Date
    Jan 2018
    Posts
    11

    Re: Grade 11 vb.net

    Hi everyone, Just want to say thanks for helping. I Figured out the code. made my motor spin both ways with the code and figured out how to attach to relay. I just need to build the machine now. software works fine. Thanks again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width