turning on leds one after another

colin9891

New Member
I am using the picaxe 18x in a project for my leaving certificate exam.
I am making a model of a studio where each audience member will have a keypad with two switches on it, yes and no
I want to be able to create a bar graph style with the results.

If yes switch is pressed once it will turn on one led in the yes column
if yes switch is pressed twice it will turn on an extra led in the yes column
if no is pressed it will turn on the first led in the no column and so on.

Can anyody tell me what i need to do
 

eclectic

Moderator
I am using the picaxe 18x in a project for my leaving certificate exam.
I am making a model of a studio where each audience member will have a keypad with two switches on it, yes and no
I want to be able to create a bar graph style with the results.

If yes switch is pressed once it will turn on one led in the yes column
if yes switch is pressed twice it will turn on an extra led in the yes column
if no is pressed it will turn on the first led in the no column and so on.

Can anyody tell me what i need to do
Welcome to the Forum Colin.

Can you provide some more details please?

For example, how will you display the outputs;
Two very long lines of green and red LED's?


Or numeric counters?
Or something different?

e
 

colin9891

New Member
Turn on extra led one after the other

I will probably only be able to have four red leds and for green leds as there is only 8 outputs onless you can suggest otherwise.

The idea is that each audience member would have a keypad with a yes and no switch.

I will only be making two keypads as there is only 4 outputs unless you can suggest otherwise.

Would it be possible to limit each keypad to turn on one output (led) only as each audience member would be allowed to make one choice only, yes or no.

Any ideas
 

hippy

Ex-Staff (retired)
Edited :Crossed posts, and questions answered above :)

Also how many audience members / keypads ?

Could you also clarify the functional specification please ...

If yes switch is pressed once it will turn on one led in the yes column
if yes switch is pressed twice it will turn on an extra led in the yes column
if no is pressed it will turn on the first led in the no column and so on.


Should that be "if one yes switch pressed on a keypad it lights a yes LED, if another yes pressed on a different keypad it ights another. Similar for no" ?

Does each member get one press of their yes / no or can they make multiple presses ? Is there any option for the audience to change their mind ?
 

eclectic

Moderator
I will probably only be able to have four red leds and for green leds as there is only 8 outputs onless you can suggest otherwise.

The idea is that each audience member would have a keypad with a yes and no switch.

I will only be making two keypads as there is only 4 outputs unless you can suggest otherwise.

Would it be possible to limit each keypad to turn on one output (led) only as each audience member would be allowed to make one choice only, yes or no.

Any ideas
Just some questions at the moment.

1. How much time do you have, or, are prepared to spend?
2. What's your budget?
3. Previous electronic/Picaxe experience / knowledge?
4. How easily / fast can you source components?

e

And a question just for yourself:
Is this project for learning, or just for passing an exam?
(And I don't expect an answer). :)
 

colin9891

New Member
Just some questions at the moment.

1. How much time do you have, or, are prepared to spend?
2. What's your budget?
3. Previous electronic/Picaxe experience / knowledge?
4. How easily / fast can you source components?

e

And a question just for yourself:
Is this project for learning, or just for passing an exam?
(And I don't expect an answer). :)
I dont have much time, a few weeks
I dont mind spending a small amount if absolutely necessary
I have being studying basic picaxe exercises for the past year
I have the board manufactured and working with a picaxe 18x chip
I just need help programming.
It is just for passing exam
 

eclectic

Moderator
I dont have much time, a few weeks
I dont mind spending a small amount if absolutely necessary
I have being studying basic picaxe exercises for the past year
I have the board manufactured and working with a picaxe 18x chip
i just need help programming.
It is just for passing exam
OK, and now to the board.

It's "working". Good.

Please post the schematic and
a high resolution photograph, so that
people here can make further suggestions.

e
 

colin9891

New Member
Edited :Crossed posts, and questions answered above :)

Also how many audience members / keypads ?

Could you also clarify the functional specification please ...

If yes switch is pressed once it will turn on one led in the yes column
if yes switch is pressed twice it will turn on an extra led in the yes column
if no is pressed it will turn on the first led in the no column and so on.


Should that be "if one yes switch pressed on a keypad it lights a yes LED, if another yes pressed on a different keypad it ights another. Similar for no" ?

Does each member get one press of their yes / no or can they make multiple presses ? Is there any option for the audience to change their mind ?
Yes you are absolutely right if yes is pressed it will turn on one led, if yes is pressed again it will turn on the next led, if no is pressed it will turn on the first led in the no column.

Each audience member gets one press only yes or no, they cannot change their mind.

They will be allowed choose again a few minutes later when the program resets.
 

eclectic

Moderator
Eight outputs.
That 's a very small audience.
(Insert Joke here :) )

Let's say three green (Yes) and three red (No) instead.

How about using Red and Green,
to show just the current punter's vote?

Then, use a "totaliser" for the overall vote?

Sertxd, or an LCD display should be straightforward.

e
 

colin9891

New Member
its just to show an opinion it doesnt need to be counted.
How would i go about programming it using a flowsheet on logicator for picaxe
 

hippy

Ex-Staff (retired)
With 8 outputs, 4 for Yes, 4 for No, a bit of charlie-plexing or similar should be able to get six LED's on each of those four lines and multiplexing would be able to make it appear multiple LED's were on at the same time.

With three ADC's it might be possible to have six Yes/No audience controls.
 

colin9891

New Member
With 8 outputs, 4 for Yes, 4 for No, a bit of charlie-plexing or similar should be able to get six LED's on each of those four lines and multiplexing would be able to make it appear multiple LED's were on at the same time.

With three ADC's it might be possible to have six Yes/No audience controls.
I dont know what adc's are, i would need to see how to write the program on pic logicator
 

BeanieBots

Moderator
ADC = Analogue to Digital Converter.
You could use a resistor network with your buttons and measure the analogue voltage to determine which button(s) are pressed.

Have a read of this thread which goes into more detail.
http://www.picaxeforum.co.uk/showthread.php?t=7791
There been many other postings on the subject.

Unfortunatley not many here support logicator, most prefer to write in basic but I'm sure someone will assist.
 

westaust55

Moderator
Even with just 4 LED’s if you count in binary, (0001, 0010, 0011 . . .) 4 bits/LEDs could allow up to 15 in both the Yes and No categories.

Might be too late as a suggestion for more LED’s . . . .
But since you have an 18X which has i2c comms, one option is to interface to a MCP23017 i2c IO expander which gives you two 8-bit ports for a total of 16 IO to drive the LED’s Then 8 for yes and 8 for no or if binary counting 255 for yes and 255 for no.
 

boriz

Senior Member
For 8 users and 4 LEDs in each column...

That’s 16 user buttons, plus the master control with two more buttons, one to enable the keypads, one to reset the keypads. Another could be employed to reset the scores, but cycling the power could do that.

An IO expander will be required. Something like this.


And that opens some more multiplexing possibilities. All you need then is the software. Simple huh?
 
Top