programing a usb keypay

dose anyone know a code that i can use for programing a keypad using the usb port on the arduino mega? im making a portable football scoreboard and i have a 21 key keypad to inter the numbers and time and everything! this is my first time on this site so i dont know what im doing but i need help and didnt know where else to get it! also i dont know how to make the clock run and switch from min and sec to secs and millisec like they do on a real football scoreboard.

Provide a link to the keypad. I'm sure if it is just a matrix keypad, there's code to connect it. I have no idea what min/sec to sec/ms means. Never seen it before. What display do you have? Do you mean football or American football?

also i dont know how to make the clock run and switch from min and sec to secs and millisec like they do on a real football scoreboard.

Check my stopwatch class to measure time - www.arduino.cc/playground/Code/StopWatchClass -

A simple timer : (code not tested )

void setup()
{
  Serial.begin(115200);
}

void loop()
{
seconds = millis() /1000;   
minutes = seconds % 60;   // % = modulo
seconds = seconds - minute * 60;

Serial.print(minutes);
Serial.print("  \t");
Serial.println(seconds):
delay(100);
}

homework, build in the stopwatch class iso the millis() and the button.

this is the keypad i am using! imean american football. i see that the keypad is programble but i dont know what im doing on that part

Well, the keypad is intended for a PC so you can't plug it in a regular arduino. You will need an arduino usb host shield to talk to this keypad. Being programmable means you can assign say one key the role of running the calculator when pressed, for convenience, not to be confused with arduino programming.

If you get a matrix keypad like this one, you can connect it to arduino directly:

http://www.arduino.cc/playground/Code/Keypad

now if i use that keypad can i use 2 on the same arduino but make one do something diffrent then numbers

If you are wanting a clock to switch to seconds after counting down minutes

1:00 --> 59.9 that is all code ...
now what is the keypad for?

marine-itt2011:
now if i use that keypad can i use 2 on the same arduino but make one do something diffrent then numbers

Maybe just the keys in the top row can be redefined. The problem is, you have to use a PC to tell arduino what key was pressed. Arduino can't talk to the keypad unless you want to buy a shield to enable arduino to talk to it.

http://parts.digikey.com/1/parts/960974-keypad-20-key-w-removable-cap-86jb2-203.html

hey is a link to another keypad... would this keypad be able to talk to the arduino mega with out using a pc

http://parts.digikey.com/1/parts/961001-keypad-12-key-front-panel-mnt-96ab2-102-f.html

or can i use 2 of this kind of keypad?

@Awsomdk: the keypad is for entering the score and time and stuff for a pig skin football scorebored

The way you stated in in the original post was that you needed a way to swap the time to seconds after counting down minutes (lol)
and yes I know about what you wanted the keypad for ... looked like others had that covered....

@Awsomdk: thanks for the code... is that all the code needs or is their more

there is lots more... first we need to know what hardware you will be getting...
The Shield
The other keypad...
after that I'm sure that everyone here could help you...
I am slightly experienced ,but it seems like I make a post on here then BAM I figure it out ... so It shouldn't be hard..

http://parts.digikey.com/1/parts/960974-keypad-20-key-w-removable-cap-86jb2-203.html

this is the keypad i planed on using now and i have a arduino mega, im also using 1 4digi 7 seg display, 5 2digi 7 seg displays, and 4 1digi 7 seg display... also a power sorce i havent getten yet.. how many volts should i use... i think its 5v but i dont know

Yes, both keypads will easily work with arduino.

liudr:
Yes, both keypads will easily work with arduino.

well what kind of code would i need to work with both

http://www.arduino.cc/playground/Code/Keypad

May need modification to use on the 20 keypad but the 12 key pad needs no mod.

ok then im going to use 2 12key keypads then thanks

You are welcome. In case later you want a project to enter text, you can do multi-tap on these keypads:

http://arduino.cc/forum/index.php/topic,68986.0.html