Keyboard PC ON Arduino ?

How do I write Code on the arduino to be model of keyboard pc, connected by USB and control by using C++ ?

The simplest and easiest way is to make the Arduino look like a PS/2 keyboard, and plug it into one of the PS/2-to-USB converters available from many sources.

The USB interface on many versions of Arduino can only act like a serial port: the serial port interface is built into the hardware, and it's physically impossible to make it emulate anything else.

There's also a project someone's doing to turn the Arduino into a low-speed USB peripheral, but I haven't tried it yet. Do a search for "V-USB" and "VUSB" (I've seen it spelled both ways) to find postings from people who have.

Ran

I've seen them do it on www.youtube.com.
keypad - YouTube.
But I do not know Code C + + in it.

thank .. . Ran

What you see in that youtube video is basically just a keypad connected to an arduino, and the Arduino connected to the PC.

Arduino decodes the keypad matrix stuff and send data to the program on the PC.

The data is send over the serial line from Arduino to the PC, so the program on the PC just have to listen to the serial port, thats all :slight_smile:

Actually, it's not doing ANYTHING like a normal Keyboard.. he's only using the Serial.println function, and he opened up a Terminal.

Basically, he just reads button pushes, then if the button is pushed.. he sends serial data back to the computer.

Fairly simple.. this is just an example, not tested.:

byte buttonPin = 10;
byte buttonPin2 = 11;

void setup()
{
Serial.begin(9600);
digitalWrite(buttonPin, HIGH);
digitalWrite(buttonPin2, HIGH);
pinMode(buttonPin, INPUT);
pinMode(buttonPin2, INPUT);// these turn on the Internal Pull-up resistors
}

void loop()
{

if(digitalRead(buttonPin) == LOW) // if button is LOW
{
Serial.println("Sw1"); // Serial print line, "Sw1" just like video
}

if(digitalRead(buttonPin2) == LOW)
{
Serial.println("Sw2");
}

}

I understand the information you are trying to teach me and to thank you very much.
For MikMo and CaptainObvious.

Sorry for my English,.