Creating Your Own Keyboard From Scratch – Wired Communication

Summary Page

While talking about the perils of getting wireless communication between the keyboard parts working I forget to show the final wired solution. I guess the post is long enough though. So here follows the actual implementation. At first you have to configure both serial interfaces to the same baudrate. I do this in the “setup()” function. I use the hardware serial interface on the left side and on the right side I use SoftwareSerial (the hardware serial interface is used for communication with the BlueSmirf HID). The following gist shows the sending of the key state: [gist 3987093/] As you can see I still use some basic protocol. It is a remnant to the RF trials but as soon as I integrated the mouse behavior it came in handy. Sending the mouse move to the right side of the keyboard is straight forward, too: [gist 3987080/] The next gist shows the receiving of the signals on the right side of the keyboard. Basically I’m looking for the beginning of a key or mouse message read the following values until the message end signal is received: [gist 3987144/] That’s all there is to it. Much simpler than the RF solution and more reliable and faster. Praise the wire. But now I have to fight the ever twisting cable. Fortunately I chose the cable to be long enough (around 1,5 meters).

Summary Page

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s