Convertible Screens

Some time ago, I bought a Dell Latitude XT2. In a nutshell, it’s a medium-sized laptop which has a convertible touch/tablet screen.

Both touch and tablet have their uses, but during my first serious contact, I had to realise that the touch screen is not always useful: while I was drawing a picture with the pen, my palm activated the touch screen, resulting in lots of dots and occasional lines where they didn’t belong.

The internet proved to be less useful than I had hoped for, since most solutions referred to xorg.conf – which ceased to exist for Ubuntu with 11.10 (oneiric) for whatever reason.
However, there are different methods to achieve this which I will summarise here.

Step 1: Deactivating the touch screen

First, you need to find out the name of your touch screen using xinput –list, which should give you a list like this:

⎡ Virtual core pointer                   id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer         id=4    [slave  pointer  (2)]
⎜   ↳ N-Trig Touchscreen                 id=12   [slave  pointer  (2)]
⎜   ↳ N-Trig Pen stylus                  id=13   [slave  pointer  (2)]
⎜   ↳ PS/2 Generic Mouse                 id=15   [slave  pointer  (2)]
⎜   ↳ N-Trig Pen eraser                  id=17   [slave  pointer  (2)]
⎜   ↳ N-Trig Pen pad                     id=18   [slave  pointer  (2)]
⎜   ↳ N-Trig MultiTouch                  id=11   [slave  pointer  (2)]

Since N-Trig Touchscreen didn’t work for me, I picked N-Trig MultiTouch which did the trick for me. Now, you can switch it off using

xinput set-prop "N-Trig MultiTouch" "Device Enabled" 0

and back on using 1 instead of 0.

xinput set-prop "N-Trig MultiTouch" "Device Enabled" 1

Step 2: Rotating the screen

You can find out your screen’s name using xrandr –current, which should give you something like

Screen 0: minimum 320 x 200, current 1280 x 800, maximum 8192 x 8192
LVDS1 connected 1280x800+0+0 (normal left inverted right x axis y axis) 261mm x 163mm panning 1280x800+0+0
   1280x800       60.1*+
   1024x768       60.0  
   800x600        60.3     56.2  
   640x480        59.9  
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)

As you can see, LVDS1 is listed as connected. It can now be rotated using

xrandr --output LVDS1 --fb 1280x800 --rotate inverted

–output specifies which output device is to be modified
–fb 1280×800 specifies the screen resolution (strictly, this is not needed for a 180° rotation)
–rotate inverted (right/left/normal) rotates the screen 180° (90° clockwise/90° counter-clockwise/standard orientation)
For 90° rotations, you also need to adapt the resolution with –fb 800×1280.

Step 3: Rotating input devices

Finally, the input devices also have to be rotated in order to match the screen.
Using the above rotation method, mouse input (and touchpoint/touchpad input) is already rotated correctly.

xsetwacom set "N-Trig Pen stylus" Rotate half

Again, you need the device names. All devices that can be altered using xsetwacom can be found using xsetwacom –list.
Rotate none sets the orientation back to normal.
Note that rotating left and right may seem slightly unintuitive :
Rotate cw rotates the input 90° left and
Rotate ccw rotates it 90° right.

The touchscreen has to be rotated differently, but so far I haven’t tried it yet (once I have, I will add the solution here – in theory it can be done using xinput).

The scripts

180°

xrandr --output LVDS1 --fb 1280x800 --rotate inverted
xsetwacom set "N-Trig Pen stylus" Rotate half
xinput set-prop "N-Trig MultiTouch" "Device Enabled" 0

90° left

xrandr --output LVDS1 --fb 800x1280 --rotate left
xsetwacom set "N-Trig Pen stylus" Rotate cw
xinput set-prop "N-Trig MultiTouch" "Device Enabled" 0

90° right

xrandr --output LVDS1 --fb 800x1280 --rotate right
xsetwacom set "N-Trig Pen stylus" Rotate ccw
xinput set-prop "N-Trig MultiTouch" "Device Enabled" 0

Back to normal

xrandr --output LVDS1 --fb 1280x800 --rotate normal
xsetwacom set "N-Trig Pen stylus" Rotate none
xinput set-prop "N-Trig MultiTouch" "Device Enabled" 1

Arduino Tetris Choir

After a long time spent on my master thesis, I’m back to my projects!

Next week, there’s an Arduino Workshop by Chaos inKL., so we met this week to prepare some demos to show the participants.

I tried out the tone library and it’s incredibly easy to use – easy enough to create a multi-score tetris melody within two hours or so. Here’s a demo!

(Also, I’m still working on my moodlight and there will be updates.)

Other MoodLight Projects (or Related Work)

During my work on the MoodLight, I stumbled upon a couple of cool projects that are similar to mine.

USB Pen v1

Tom created this very pretty USB pen style notifier. I love the star shape!

Finished Gadget
Code

Notifier Cube

DaveHillier stripped a freebie cube of its interior and replaced it with a strip board (and components, obviously). Great example of using what you have. Also it’s pretty close to what I originally imagined.

Breadboard prototype
Finished gadget
Code

USB Pen v2

Dennis/AlphaCentauri also built a USB-Pen style notifier. Quite similar to the first one, but I like the lava lamp plus he provides his code.

Prototype
Etched board
Finished gadget
Code

Netbook LED

Justblair drilled a hole in the case of his EeePc and built a circuit board using some strip board, an atTiny, a couple of resistors and diodes, and an LED. Simple and neat.

Netbook mod
Code by Dennis/AlphaCentauri

The beginnings of the MoodLight project

After hanging around with the people from Chaos inKL. for a while, I decided I wanted to learn more about electronics.
My first idea was to use one of those standard robot toy kits – but what was I going to do once I finished soldering? I already have plenty of stuff collecting dust on my shelves, so why add another?

Instead, gonium suggested I should have a look at the Fnordlicht project. I decided to use the small version. The board uses a 3×3 array of single-colour LEDs (RGB, 3 each) and can communicate via serial port if a TTL to RS232 adapter is connected.
So why not make a device that blinks when I get an IM message?

I soldered the Fnordlicht, made the mistake to use a resistor instead of a diode (despite double and triple-checking!) and had to unsolder it and remove the solder from the hole. This proved to be quite challenging, so 3-5 people tried to help me until one of them ripped off the land in the process. I ended up using a needle… and replacing the missing land with a solder strap. What can I say… it worked.

After that, I experimented a bit with microcontroller C. It’s not all that different from what I usually use (mostly C++), but it does use different data types (I once hunted a bug for an hour before I realised I had used int rather than uint8_t) and of course, it’s not object-oriented (but if your program only has only 8kB space, you wouldn’t want that anyway).

Playing around with colour hex codes and parsing them was fun, but I needed communication. This required soldering an TTL to RS232 converter which was quite easy after the rather densely packed Fnordlicht.

In parallel, I tried creating a Pidgin plugin for my device. However, the documentation is vastly outdated (2006) and the tutorial on the topic I needed most (communication) was planned but never created. In the end, I decided that I should try using libnotify directly, but for the time being, I started communicating with the moodlight directly via the serial port.

I used uartlib for this, but while I was working on it, I decided that one cable for both communication and power supply would be awesome, so the idea of MoodLightUSB was born.

Welcome

Some people may have seen my old homepage before – mostly white and purple, static, with some random texts. Not very shiny and not too nice to update since the things I wanted on there was, and still is, distributed over various online platforms.

WordPress is rather wide-spread and offers lots of plugins to integrate other content, so I hope I can collect my stuff in one place.

During the next weeks, the page will hopefully grow!