![]() |
![]() OCAU News - Wiki - QuickLinks - Pix - Sponsors |
|
|||||||
| Notices |
|
Sign up for a free OCAU account and this ad will go away! Search our forums with Google: |
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Member
Join Date: Sep 2002
Location: adelaide
Posts: 3
|
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
|
|
|
|
| Join OCAU to remove this ad! |
|
|
#3 | |
|
Member
Join Date: Mar 2002
Posts: 873
|
Quote:
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.. |
|
|
|
|
|
|
#4 |
|
Member
Join Date: Sep 2002
Location: adelaide
Posts: 3
|
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 |
|
|
|
|
|
#5 | |
|
Off the rails
Join Date: Jun 2001
Location: Brighton, QLD
Posts: 5,000
|
Quote:
......some people....well, I just don't know they make i through life........(sigh). |
|
|
|
|
|
|
#6 |
|
Member
Join Date: Jun 2001
Location: Hong Kong
Posts: 103
|
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! |
|
|
|
|
|
#7 |
|
Member
Join Date: Sep 2002
Location: adelaide
Posts: 3
|
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 ????????? |
|
|
|
|
|
#8 |
|
Member
Join Date: Dec 2001
Location: Gifu, Japan
Posts: 262
|
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. |
|
|
|
|
|
#9 |
|
Member
Join Date: Jul 2002
Location: Sutherland Shire
Posts: 103
|
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 |
|
|
|
![]() |
| Bookmarks |
|
Sign up for a free OCAU account and this ad will go away! |
| Thread Tools | |
|
|