Page 1 of 1

Gadget for a quiz

Posted: Wed May 21, 2008 4:01 pm
by kirstom14
I want to make a gadget that is going to be used in a quiz. The quiz have 4 teams. The first team that presses the switch first, will answer. That is when pressed, an LED referring to that team will light up, and the other switches must be disabled until the system is reset through a reset switch.

This file attached is what I've done already.

What can I do?

Thanks

Re: Gadget for a quiz

Posted: Wed May 21, 2008 6:18 pm
by Steve
In a situation like this, it may be useful to think of the flow of the program as a series of states. For your program, you may only have 2 states:

1) reset state, waiting for a switch to be pressed.

2) question answered, displaying the contestant who answered first.

The program should begin in state 1. When a button is pressed, it should move on to state 2. To move back to state 1, the reset button must be pressed.

So, state 1 turns off all LED indicators. It then enters a loop and reads the state of the inputs. Whenever an input is pressed, the program will leave this loop and move on to state 2.

In state 2, the appropriate LED will be turned on. Then, it will enter a loop and wait until the reset button has been pressed. Once the reset button has been pressed, the program will jump back to the beginning of state 1.


I hope this suggestion helps.

Re: Gadget for a quiz

Posted: Thu May 22, 2008 3:13 pm
by kirstom14
I tried what you have said. And if I have understood well than the program should look like the attached one.
But the problem with what I've done is that it is not resetting.

Re: Gadget for a quiz

Posted: Thu May 22, 2008 3:30 pm
by Steve
I've attached a program that might work better...

Re: Gadget for a quiz

Posted: Fri May 23, 2008 6:40 am
by kirstom14
Thanks. I understood where the problem was. And it is working up to my requirements.

Thanks again