Hi, I was wondering if it is possible to make a Wiffle ball scoreboard that has a two digit score for each team using http://www.sparkfun.com/products/8530. I would like to have a control box type thing that has 4-5 buttons. A plus and minus a point for each team and possibly a reset button. Thanks in advance.
I was wondering if it is possible to make a Wiffle ball scoreboard
It is. Relatively easy, at that.
Hmm... OK. What would i need hardware wise, besides the 7 segment leds, buttons and an Arduino of course.
Each of the displays takes 8 pins, so you'll need either one shift register per digit, or a Mega that can devote 32 pins to the 4 digits.
Some wire and solder to connect stuff together would be useful. Perhaps a protoshield to make a semi-permanent installation.
Some source of power would be useful.
Is there a Shift Register that you recommend? Sorry i'm not very familiar with Shift Registers.
Sounds like you need my fencing scoring machine, but trimmed down a little.
Uses 8 digits, promii/arduino talking to a MAX7219 via SPI.
I use 4 for 10:00 minute timer, and 2 each for 0-99 score/
You could use t3he 4 time digits for inning, # of outs, balls, strikes.
Use the decimal points arranged in diamond for person on base.
I'd post the link, can't recall what it is from work. Search my recent posts, you can find it easily.
16 button remote to run it if you want to hang it on a wall.
@CrossRoads I'd love to make it how you supplied but I'm on a tight budget :(. That's why i decided to go basic with only four digits...
You can try requesting a sample from maxim-ic.com.
I built up my segments from individual LEDs & perfboard, you can do same to make a larger display that is readable from a distance.
You can buy a lot of parts for $60 you are spending on digits - go browse www.dipmicro.com for LEDs & futurlec.com for perfboards.
You can get a nice 20 button keyboard for $1 from www.surplussales.com
search for keypad, it is 1/2 way down the page.
Get easy to work plastic boxes from office max or staples, this brand www.reallyusefulboxes.com
5V or 12V wallwart from mjpa.com for $7.
All kinds of ways to save.
Thanks for all the links! ![]()
Oh yeah I'm having a little trouble finding your Fencing Scoring Machine.
Does it have its own thread?
try this link
http://www.crossroadsfencing.com/box_collection_small.jpg
Access is blocked for me at work, so I can't see if it opens.
If not, PM me as a reminder and I'll reply when we finish classes tonight.
I think the last time I posted it was in a thread on "breadboard and soldering" by user z3zzz or similar.
Here we go
http://arduino.cc/forum/index.php/topic,60563.0.html
Promini in the middle controls a max7221, empty sockets are header for breaking out the 7221 to the 8 digits & decimal points. Segments are 3 LEDs in parallel, high brightness (4-5,000 mcd) with current limit set by resistor on the 7221 and its multiplexing. The big blocks of 20 LEDs are driven seperately by a 7406, you wouldn' need that part, or the little cards in the middle that drive a speaker (right side) or detect when a touch is scored (left side).
Hmm... Interesting... That looks pretty cool but i have to admit that pretty much blows my mind XD. I don't know if I can make somthing that advanced... Is it possible to take, not the sparkfun 7-segment Display, LED's and do my original idea?
P.S. This is just for backyard Wiffle Ball :).
Sure, you can layout the LEDs anyway you want to make the digit shapes you want.
Here's the layout I had planned, the connector ended up moving to make the wirewrapping a little less awkward,
or maybe to make the colons look neater or something.
Expresspcb is great for laying out stuff like this.
If you want to go with shift registers to drive the digits with 5V, be sure to use some that can handle current - such as 74AC299PC from Newark.com, 56 cents, 24mA drive capability.
If you're going to string more LEDs in series and drive from say 12V, (like 5 LEDs for larger segments), then you can use ULN2003 or ULN2803 to buffer the output of a 74HC595.
Thanks for the diagram. I was just wondering if you used female or male headers or does that not matter?
Edit: Oh yeah i forgot to ask, Dipmicro has two different kind of red LED's. Should i get the 7,000-15,000mcd or the 24mcd's? Thanks.
24 will be very dim, go with the brighter - if too bright, can adjust current limit resistors to tone it down.
Headers - I actually used the bottoms of wirewrap socket pins as male headers,
www.marcospecialties.com, search for 20 pin socket strip,
(really wanted long pin version of this
Pololu - 0.100" (2.54 mm) Breakaway Male Header: 1×40-Pin, Straight, Double-Sided
but couldn't readily locate and I had the socket strips for installing ICs onto, so I used those)
then had female crimp terminated wires in crimp connector housings from www.pololu.com
8-pin version of these
http://www.pololu.com/catalog/product/1901,
I bought 2-3-4-5-6-8, handy to have as I worked out the design
with these wires in different lengths as needed
http://www.pololu.com/catalog/product/1800
I bought 50-packs of different lengths, really handy to have.
and slid the resulting cable onto the wirewrap pins. That way all cables stayed behind the boards and the LEDs could be mounted to the inside face of the cover using #4-40 screws & nylon standoffs going thru 1/8" hole in the cover and the perfboard (mark & drill the holes on both before you add components!)
Pololu - Nylon Spacer: 10mm Length, 5mm OD, 3.3mm ID (25-Pack) - maybe this size, check the inner diameter
Thanks for the info! I was wondering if I could look at your code, if you still have it and don't mind if i look at it, because i have very little experience in coding.
Not sure it will help if you take a different hardware approach - mine is specific for the max7221, which I was able to get as samples from maxim-ic.com. The 7221 has the segment decoding built in, so I send it register # & data to display, (ex. register1, 6).
If you are using shift registers, a different approach will be needed. You would use shift out, and have to create an array with your font definition:
example font_array[0] = b00111111; // = 0, where bit 7 is not used, 6 = segment G, 5 = segment F, 4=E, 3=C, 2=B, 1=A
and 1 = a segment on
A
F B
G
E C
D
font_array[1] = b00000110; // = 1
font_array[2] = b01011011; // = 2
and 0 or 1 might depend on whether you have common cathode or common anode parts.
I prefer common anode, then pull cathode low on each segment to turn it on.
Then update each digit indivually as they change.
Example: digit1 is the score to be displayed, updated with your button pushes.
datapin & shiftclock go to all registers, digitX_clock goes to each register individually,
this is it basically:
void loop(){
[read button presses code, set a flag if see one pressed
use debounce to catch the presses
digit1=digit1+1 if score went up, digit1=digit1-1 if score went down
digit1_flag = 1 if score was changed up or down
repeat for digits 2,3,4
put in some error checking to go below 0, or to rolled from 9 to 0 and increment next digit, etc.]
if(digit1_flag ==1){
shiftout(datapin, shiftclock, MSBFIRST, font_array[digit1]);
digitalWrite(digit1_clock, LOW);
digitalWrite(digit1_clock, HIGH); // assumes rising edge stores the data in output register
digit1_flag = 0; /; clear the flag for the next press
}
// repeat for digits 2,3,4
} // end void loop
I'm gonna have to look at that closely but I have to go really soon. Do you think it would be easier to modify this code?
//define pattern
int all[8]={2,3,4,5,6,7,8,9};
int zero[6]={2,3,4,6,7,8};
int one[2]={4,6};
int two[5]={6,7,9,2,3};
int three[5]={6,7,9,4,3};
int four[4]={4,8,9,6};
int five[5]={7,8,9,4,3};
int six[6]={7,8,9,4,3,2};
int seven[3]={4,6,7};
int eight[7]={2,3,4,6,7,8,9};
int nine[6]={6,7,8,9,4,3};
int dot[1]={5};
int pot=0;
void setup(){
int i;
for(i=0;i<8;i++){
pinMode(all[i],OUTPUT);
}
Serial.begin(9600);
}
void loop(){
int potvalue=analogRead(pot);
int number=map(potvalue,0,1023,0,9);
switch (number){
case 0: lightOn(zero,6);break;
case 1: lightOn(one,2); break;
case 2: lightOn(two,5); break;
case 3: lightOn(three,5); break;
case 4: lightOn(four,4); break;
case 5: lightOn(five,5); break;
case 6: lightOn(six,6); break;
case 7: lightOn(seven,3); break;
case 8: lightOn(eight,7); break;
case 9: lightOn(nine,6); break;
}
}
void lightOn(int pattern[],int length){
int i;
//light off all leds
for(i=0;i<8;i++) //int type stores a 2 byte value
{
digitalWrite(all[i],LOW);
}
//light on pattern
for(i=0;i<length;i++) //int type stores a 2 byte value
{
digitalWrite(pattern[i],HIGH);
}
}
This code is for one 7-segment display and uses a potentiometer to make the number go up and down.
Thanks.
No, I don't think so. There is no button reading code, maybe you could borrow the array definitions & case statement for the shiftouts. Make it a function and call it after you read the buttons and develop your new score to display. The array reading code I noted will do the same without needing 10 case statements tho.