Hi guys,
I'm relatively new to Picaxes and coding in general (though I've successfully churned out some useful gadgets already), and my current project has me stumped.
What I'm trying to do, is to use a 20m2 (or 20x2 if necessary), to read the ADC of a few knobs to generate a table of values, and randomly display each one only once through a 7 segment display.
Essentially, I'm making a unit for my Lazertag group, that you set the number of players per team (only 2 teams), and spies, and pass the unit to each player who is then privately assigned their role as a player or spy accordingly.
For example, if the unit is set to 5 players per team, and 1 spy, then it would generate a table containing 4xT1 4xT2 1xT1-S 1xT2-S, and upon a button press display either "1", "2", "1 _ S", or "2 _ S"... Each displayed privately to the player assigning them to team 1, team 2, team 1 (spying for team 2), and team 2 (spying for team 1), respectively. Ensuring that the device displays each value randomly once and only once. (Alternatively, I may simplify this to use a simple array of just 3 LEDS, 2 for team, and a separate one for spy, in which case I'd likely switch to 08m2).
And I can only think of doing this by means of a very convoluted series of if-thens..
Any ideas?
Thanks!
I'm relatively new to Picaxes and coding in general (though I've successfully churned out some useful gadgets already), and my current project has me stumped.
What I'm trying to do, is to use a 20m2 (or 20x2 if necessary), to read the ADC of a few knobs to generate a table of values, and randomly display each one only once through a 7 segment display.
Essentially, I'm making a unit for my Lazertag group, that you set the number of players per team (only 2 teams), and spies, and pass the unit to each player who is then privately assigned their role as a player or spy accordingly.
For example, if the unit is set to 5 players per team, and 1 spy, then it would generate a table containing 4xT1 4xT2 1xT1-S 1xT2-S, and upon a button press display either "1", "2", "1 _ S", or "2 _ S"... Each displayed privately to the player assigning them to team 1, team 2, team 1 (spying for team 2), and team 2 (spying for team 1), respectively. Ensuring that the device displays each value randomly once and only once. (Alternatively, I may simplify this to use a simple array of just 3 LEDS, 2 for team, and a separate one for spy, in which case I'd likely switch to 08m2).
And I can only think of doing this by means of a very convoluted series of if-thens..
Any ideas?
Thanks!