Author Topic: Another version: 3 Button Pen.  (Read 6774 times)

Offline ipb

  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
on: June 23, 2008, 09:47:51 PM
Hi.
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:
|1|0|1|0|;
an action code:
|1|1|  to the right click,
|0|0|  to the programmable click;
a stop bit:
|1|.

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:
  • 1 - 16F648A
  • 1 - 12ohm resistor
  • 1 - TSAL6400
  • 3 - buttons
  • 1 - batteries Holder

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

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

Images:

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

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

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

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


Regards,

Pedro and Paulino



Offline UndCon

  • Support Admin
  • *
  • Posts: 566
  • Karma: +11/-3
    • View Profile
    • UndCon
Reply #1 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...