Wiimote Project

Wiimote Projects => Wiimote Interactive Whiteboard => Topic started by: ipb on June 23, 2008, 09:47:51 PM

Title: Another version: 3 Button Pen.
Post by: ipb on June 23, 2008, 09:47:51 PM
We have been making some additions to the Whiteboard code:

We have built a new pen based on a MicroChip chip, the 16f648A. This new pen has three buttons. One button is the normal click. The other one is the right click button and the last button allows to be configured to fire any key code. To the right click and to the programmable click the 16f648A excites the LED with a stream of bits. This stream is sent at 100 Hz to the Wiimote.
It has a preamble:
an action code:
|1|1|  to the right click,
|0|0|  to the programmable click;
a stop bit:

Example: When we want the right click the pen should send: |1|0|1|0||1|1||1|.
This makes a latency of 70ms, but is not perceptible.

The left click continues working as in the simple pen (all bits at 1 state).

It is possible put on it more buttons.

We have the smoothing function too. You can define arbitrarily the number of samples that will be used to calculate the average position. When you start moving the pen, the vector of samples is filled with the initial position. This makes the inertia a constant, as the number of samples is the same at the start and at the end. Thus, you can set a high samples number.

Some parameters are set in the .config file. You can define the samples number to the smoothing filter and the key code to be associated to the 3th button.

Parts list:

The source code files and the executable:
http://www.ipb.pt/~pjsr/WhiteBoard/WiimoteWhiteboard2_modV2.rar (http://www.ipb.pt/~pjsr/WhiteBoard/WiimoteWhiteboard2_modV2.rar)

The hex code (16f648A):
http://www.ipb.pt/~pjsr/WhiteBoard/ir_mod.hex (http://www.ipb.pt/~pjsr/WhiteBoard/ir_mod.hex)


http://www.ipb.pt/~pjsr/WhiteBoard/3Pen.jpg (http://www.ipb.pt/~pjsr/WhiteBoard/3Pen.jpg)

http://www.ipb.pt/~pjsr/WhiteBoard/parts.jpg (http://www.ipb.pt/~pjsr/WhiteBoard/parts.jpg)

http://www.ipb.pt/~pjsr/WhiteBoard/schematic.jpg (http://www.ipb.pt/~pjsr/WhiteBoard/schematic.jpg)

fitting up:
http://www.ipb.pt/~pjsr/WhiteBoard/assembly.jpg (http://www.ipb.pt/~pjsr/WhiteBoard/assembly.jpg)


Pedro and Paulino
Title: Re: Another version: 3 Button Pen.
Post by: UndCon on June 24, 2008, 03:46:08 AM
A relatively simple implementation of a common problem (rightclick)

That is something I've been thinking of as well - but I couldnt find any suiteable switches in my local store so I salvaged some old electronics in the chase of descent switches...

The schematics looks good btw...