Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: qbasic

  1. #1
    Newbie
    Join Date
    Apr 2000
    Posts
    51

    Post qbasic

    For some time now I have wanted to control a lcd in qbasic. The reason for qbasic is that I know more about it then i do about any other programming lang. and I have many simple games like frogger and pong and tic tac toe that would work reall good on a 40 x 4 and a 20x4 lcd disply. Looking for a way to control a lcd i found the "IOCTL" command in qbasic. "IOCTL" is basicly a device driver. The only problem with using this command is that I dont have or know how to write a driver for a lcd character disply. So onto the the next way. In qbasic you can you use the command "SHELL" to get a hold of the dos prompt. Sense lcd can be used in c++ technicly you could write a program in c++ with different dos command option that would minupilate the disply. There for you could use qbasic and the dos command line to write to a lcd disply. The only problem with this is that I am not good enough in c++ to know how to write a program that would do this. So by now you are probably wondering what the reason for this post is. Well I was wondering what everyone thinks about what I just said and also if anyone would be willing to write a program in c++ that would except command line option or write a driver that would work with qbasic.

    xzol@hotmail.com

    sorry for the misspelled words. Its in my genes, theres nothing I can do about it.

    [This message has been edited by xzol (edited 11-27-2000).]

  2. #2
    Newbie
    Join Date
    Mar 2000
    Location
    Priceton, NJ, USA
    Posts
    52

    Post

    It's been years since I've used qbasic but I think you have port access using the OUT command. If this is true it would be possible (and not that hard) to write something directly in qb. Which is what I'm guessing you really rather do anyway. If you want to try to get something working (in qb)drop me some mail and we'll talk about it some more.

    Oh yeah I have blackjack outputted to my LCD but frogger would be hilarious. =)

    Have Fun,
    Blackwind

  3. #3
    Newbie
    Join Date
    Apr 2000
    Posts
    51

    Post

    Yeah I just relized "out command".
    "OUT port, byte" where port is the address of the specified port and is an integer in the range 0 through 65535 (or 0 through FFFF in hexadecimal). Byte is a value in the range 0 through 255. The only problem that I can find is that what is the port of LPT1. Also, the out statement can only send 1 byte of data at a time, I dont know if this would be a problem but it may be an issue. So Ill we need to do now is figure out what the port # is of lpt1. Is there a way to figure it out in qbasic.

  4. #4
    Newbie
    Join Date
    Mar 2000
    Location
    Priceton, NJ, USA
    Posts
    52

    Post

    When it says port it's looking for the base address of the port. This can be found in your bios or under your windows control panel (the system one). Just note that these numbers will be in HEX so make sure to note it that way in qb (&Hnnn). Just so you know the default address is for parallel port 1 (ltp1) is &H378 and lpt2 is &H278.

    Now as for the data (bytes) to send it's really a matter of how you wired your LCD, But you'll never be sending more then one at a time to it anyway so OUT will work fine.

    Good Luck,
    Blackwind (blackwindx@yahoo.com)

  5. #5
    Newbie
    Join Date
    Apr 2000
    Posts
    51

    Post

    I totally forgot how to find the port address. Thanks for reminding me. But how do you send information to the disply. "OUT port,byte", what do you replace the byte with. If you could give me an example. Maybe if i had data sheets to my lcd hd44780 40x4 i could figure it out.

  6. #6
    FLAC
    Join Date
    Aug 1999
    Location
    Upper Marlboro, MD 20772
    Posts
    1,311

    Post


    outp(LPTbase+LPT_DATA, data);
    outp(LPTbase+LPT_CTRL, DataCodeOn());
    delay(DLY_CTRL);
    outp(LPTbase+LPT_CTRL, DataCodeOff());



    ------------------
    abcd-1
    Author of CobraI and CobraII.
    For more information on the COBRA Application's please visit the link. For the latest or updated info on CobraII please click on the link. Get new updated files for CobraII here. ftp://picturesictures@128.8.187.126/d:/newdlls
    You can contact me on AOL instant messenger....nick is Cenwesi
    Webpage comming soon!
    abcd-1
    Author of CobraI,II,III and now CobraIV.
    You can contact me on AOL instant messenger....nick is cenwesi or cenwesi3

  7. #7
    Newbie
    Join Date
    Apr 2000
    Posts
    51

    Post

    Isnt that in c++. What about qbasic cenwesi.
    Do you know of an example in qbasic.

  8. #8
    FLAC
    Join Date
    Aug 1999
    Location
    Upper Marlboro, MD 20772
    Posts
    1,311

    Cool

    try this page....i belive he has either VB or qbasic example there. Infact i think the same command u use in VB can be used in Qbasic if memory serves me right. And btw, i seriously think u should do this in c/c++.
    http://henrik.husted.net/

    ------------------
    abcd-1
    Author of CobraI and CobraII.
    For more information on the COBRA Application's please visit the link. For the latest or updated info on CobraII please click on the link. Get new updated files for CobraII here. ftp://picturesictures@128.8.187.126/d:/newdlls
    You can contact me on AOL instant messenger....nick is Cenwesi
    Webpage comming soon!
    abcd-1
    Author of CobraI,II,III and now CobraIV.
    You can contact me on AOL instant messenger....nick is cenwesi or cenwesi3

  9. #9
    Retired Admin Aaron Cake's Avatar
    Join Date
    Jan 2000
    Location
    London, Ontario, Canada
    Posts
    2,464

    Cool

    Don't bother trying to find the address. LPT1 is decimal 888. So:

    OUT 888,1

    would turn on bit 1 of LPT1. See http://www.aaroncake.net/electronics/qblpt.htm for information on programming the parallel port.

    ------------------
    Aaron Cake
    London, Ontario, Canada

    Player: Cyrix 200, 32MB RAM, 10.2Gig Quantum HD, Onboard EtherNet/Sound/Video, Custom Lexan Case, Arise DC-DC, Win95 Kernal w/Custom Player
    Car: '86 Mazda RX-7 w/Basic Performance Upgrades
    Player: Pentium 166MMX, Amptron 598LMR MB w/onboard Sound, Video, LAN, 10.2 Gig Fujitsu Laptop HD, Arise 865 DC-DC Converter, Lexan Case, Custom Software w/Voice Interface, MS Access Based Playlists
    Car: 1986 Mazda RX-7 Turbo (highly modded), 1978 RX-7 Beater (Dead, parting out), 2001 Honda Insight
    "If one more body-kitted, cut-spring-lowered, farty-exhausted Civic revs on me at an intersection, I swear I'm going to get out of my car and cram their ridiculous double-decker aluminium wing firmly up their rump."

  10. #10
    Newbie
    Join Date
    Apr 2000
    Posts
    51

    Post

    But how do you send somthing to the disply. Im starting to understand the binary thing but i still have questions.
    if 11111111 = 255
    and 00000000 = 0
    what does 1 through 254 equal....
    i would be very greatful if someone could write a simple examp in qbasic that printed a simple character to the disply.....

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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