Overclockers Australia Forums
OCAU News - Wiki - QuickLinks - Pix - Sponsors  

Go Back   Overclockers Australia Forums > Software Topics > Programming & Software Development

Notices


Sign up for a free OCAU account and this ad will go away!
Search our forums with Google:
Reply
 
Thread Tools
Old 2nd September 2002, 10:31 PM   #1
amssc5 Thread Starter
Member
 
Join Date: Sep 2002
Location: adelaide
Posts: 3
Default qbasic help needed

I am trying to write a program to run comp. operated xmas lights. I have written a faily basic program that turns the lights on and off in given sequences but its fairly limited. The system runs out of the printer port into a control box that then runs four leads off it to power the lights. Can anyone help me to find some info on this type of programing as everywhere I look its about writing games and I cant seem to make a conection between the two.

Any help greatly appreciated
amssc5 is offline   Reply With Quote

Join OCAU to remove this ad!
Old 2nd September 2002, 10:37 PM   #2
Bern
Off the rails
 
Bern's Avatar
 
Join Date: Jun 2001
Location: Brighton, QLD
Posts: 5,000
Default

Moving this to the correct forum.
__________________
Bern is offline   Reply With Quote
Old 3rd September 2002, 7:28 PM   #3
Kermalius
Member
 
Join Date: Mar 2002
Posts: 873
Default

Quote:
Originally posted by Bern
Moving this to the correct forum.
No you didn't. Qbasic (minus compiler) is distributed with MS-DOS (and win 95).. Microsoft joy.

On the helpful side however, what are you actually trying to do? Outputs are nice,very usefull. Are you trying to make them operate in a specific/psuedo random patten or what?

What you want to look into (I think) are control structures. All those loops (goto's), if's/elif/else (goto/goto/goto) and other (goto) structures than litter programs and make them actually do something useful and non linear.

Basically, the same stuff that makes the games play and not just display something then exit.

Try and be a little more specific..
Kermalius is offline   Reply With Quote
Old 3rd September 2002, 9:39 PM   #4
amssc5 Thread Starter
Member
 
Join Date: Sep 2002
Location: adelaide
Posts: 3
Default more info..........

the system that I have had made for me is a control box that has four electric plugs coming from it. you plug for example four individual light sets into the plugs. then by using the program you can turn each set of lights on and off in a order given by the program. I have managed to get the lights to turn on and off in sequence or by using a different sequence make them flash but I am interested in getting them to go a bit further and try more than just simple things like this. for example if I could get them to follow one sequence for 5 repeats and then do another sequence I would be happy........I'll try to give an example

1- on then off 2 on then off 3 on then off 4 on then off
1- on then off 2 on then off 3 on then off 4 on then off
1- on then off 2 on then off 3 on then off 4 on then off
1- on then off 2 on then off 3 on then off 4 on then off
1- on then off 2 on then off 3 on then off 4 on then off

all on flashing on and off for 10 seconds then repeat

does this make it clearer if not I would be happy to email you what I have so you can look at it
amssc5 is offline   Reply With Quote
Old 3rd September 2002, 11:05 PM   #5
Bern
Off the rails
 
Bern's Avatar
 
Join Date: Jun 2001
Location: Brighton, QLD
Posts: 5,000
Default

Quote:
Originally posted by Kermalius


No you didn't. Qbasic (minus compiler) is distributed with MS-DOS (and win 95).. Microsoft joy.
So....amssc5 is having a programming problem...I move his thread to the programming forum and you think I got it wrong?
......some people....well, I just don't know they make i through life........(sigh).
__________________
Bern is offline   Reply With Quote
Old 5th September 2002, 12:20 PM   #6
batkung
Member
 
batkung's Avatar
 
Join Date: Jun 2001
Location: Hong Kong
Posts: 103
Default

you're doing this in qb45???

it would have been a whole lot easier to do it straight in asm through debug.

anyway, a good reference for using qb45 in advanced mode (ie, interfacing with asm subs) is Advanced Basic...I think it's by peter norton....you can do a search for it on amazon I'm sure.

wow, someone still using qb....it's been years since I touched it!
batkung is offline   Reply With Quote
Old 5th September 2002, 9:10 PM   #7
amssc5 Thread Starter
Member
 
Join Date: Sep 2002
Location: adelaide
Posts: 3
Default thanks

thanks I'll go look.........

the reason I started using qb is because the person that helped me set up the controller and everything was an oldtimer and that was what he was using..... and when you dont know and someone has taken the time out all you can be is grateful

p.s. what is asm ?????????
amssc5 is offline   Reply With Quote
Old 6th September 2002, 1:06 AM   #8
Kremlin
Member
 
Kremlin's Avatar
 
Join Date: Dec 2001
Location: Gifu, Japan
Posts: 262
Default

asm is assembly language.

btw, about this problem, is it possible to have individual lights turn on? because it almost sounds like you are outputting something on the LPT1 port to the box which just turns all lights on, is it possibly an issue with the box? If its definitely possible to turn individual lights on then you should probably set up a SUB for each light/groups of lights and call them inside a do loop or a for loop.
__________________
When all's said and done, a lot more will have been said than done.
Kremlin is offline   Reply With Quote
Old 6th September 2002, 9:46 PM   #9
adn0r
Member
 
adn0r's Avatar
 
Join Date: Jul 2002
Location: Sutherland Shire
Posts: 103
Default

I would do it similar to what Kremlin suggested.

One sub for each sequence (eg, 1-2-3-4, 4-3-2-1, on-off-on-off etc.) and then call these subs in a random or pre-determined order.
__________________
Bad command or file name
adn0r is offline   Reply With Quote
Reply

Bookmarks

Sign up for a free OCAU account and this ad will go away!

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +10. The time now is 12:23 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. -
OCAU is not responsible for the content of individual messages posted by others.
Other content copyright Overclockers Australia.
OCAU is hosted by Internode!