Author Archives: Martin Kim Dung-Pham

vim: code folding

Folding/unfolding

Use zM to fold all code.

Use zR to unfold all code.

Use zo to unfold at the current cursor position.

Use zc to fold at the current cursor position.

Setting fold levels

You can set the fold level directly by entering

:set foldlevel=1

Add this line to your .vimrc to have the same behaviour whenever vim starts.
set foldlevelstart=1

 

Schall & Rauch

I have just fixed a bug for the library’s database of the Musical Insitute of the University of Hamburg. The bug was introduced with an update to a new php version on the server side of the university. When solving their issue I also fixed an issue that prevented my Schall & Rauch iPhone app from working correctly. So for everyone who is using the app – it’s back to life!

Happy searching to everyone : )

edsync & edsync²: support for University library of Kiel

The University library of the city of Kiel has joined the list of supported libraries. If you are a student there, be sure to check out edsync or edsync² and give some feedback on your impressions. And whether or not it’s working… I had no access to a test account, so feedback is highly appreciated. You can also write an email. The address can be found here.

Monotrilicht Eclipse Project

Here comes the Eclipse Project of monotrilicht Android App as promised in an earlier post.

I have taken most of the code from the Android BluetoothChat example project and adapted it to my needs to connect and talk to monotrilicht via bluetooth. The modifications include a generalization of the BluetoothChatService to BluetoothService so you may reuse it in your own application. The Android Example has already been very well documented and I have followed their pattern so you should easily understand what is going on. Just by looking at it! This is my first Android App and I am open to any suggestions and remarks whatsoever.

Here is the zipped project file.

The Arduino .pde will follow. I have to do some more beautifying : )

Bluetooth enabled monotrilicht!

This is some news from the trilight zone : )

As I have mentioned in this post before, I recently played around with my Arduino. Sparkfun Electronics has some breakout boards for Roving Networks’s Bluetooth modules. I bought the Bluetooth Mate Silver with a RN41 bluetooth module on it last year. Now its time has come to show off a little. I have attached it to the monotrilicht and voilà, bluetooth chatting with the RGB LED. Great success and really much fun. I followed the Android Developer Guide for Bluetooth and found their bluetooth example project called BluetoothChat. Hence, chatting with monotrilicht : ) I had trouble getting the Android device and the bluetooth module connect at first, but after changing the UUID to the well-known SPP UUID 00001101-0000-1000-8000-00805F9B34FB and configuring the bluetooth module via hyper terminal it finally worked. It’s great fun to enter a ‘r’ or ‘b’ letter in a textfield on the phone and see the light turn red or blue, respectively. I can also change the hue value in steps by 20 around the 360° color circle by entering ‘<‘ or ‘>’. Code is currently of a hacked state and not quite beautiful to look at. I will publish it together with the Eclipse Project files in another post.

[update: you can find the eclipse project files in this post]

 

FAG-TI talk/slides

On 28th September I held a short talk about EDsync at a meeting of the “Facharbeitsgruppe Lokale Geschäftgänge – Technische Infrastruktur” at the library of the University of Hannover. The FAG-TI is a gathering of people organizing the libraries’ IT infrastructure within the GBV, Common Library Network of the German States Bremen, Hamburg, Mecklenburg-Vorpommern, Niedersachsen, Sachsen-Anhalt, Schleswig-Holstein, Thüringen and the Foundation of Prussian Cultural Heritage. They are quite interested in bringing their services to mobile devices. The libraries within GBV make use of OCLC’s OPAC, a web service that allows library guests to see a list of loans and charges and so on. The service is hosted on the libraries’ servers. EDsync is an app for iOS I made available on the App Store in July last year. As far as I know my App is the only one of its kind concerning native apps running on mobile devices and offering an exact match of OPAC functionality. So back to the event: I held this talk and showed some slides. I made a pdf out of those. If you’re interested and a student/guest occasionally visiting one or more of the supported libraries you may want to have a look at the pdf. The texts are in german language but there’s a ton of screenshots (in english : ) ), so you won’t be bored even if you don’t speak german – yet. I think the slides give you a good overview of the app’s functionality. You might have seen it on the App Store but refrained from downloading it as you were not sure what it’s all about. In this case, here you are: download the slides as pdf .

tinoffifteen tin canned LEDs

tinoffifteen will house 15 RGB LEDs inside a small tin can. It’s work in progress and will not see the light of day before November this year. But I’m so exited about it. You can’t imagine : )

The LEDs will be driven by 2 multiplexers/demultiplexers (4067BE and 4052BE). The larger one has 16 input/outputs for enabling/disabling each LED (common anode) and the smaller one is a 2×4 of which I will only use one common input and handle 3 input/outputs (aggregating red green and blue lines for all LEDs). What you see dangling around in the pictures are the 15 future anode lines already attached to 4067BE.

The HMC 5843 triple axis magnetometer breakout by Sparkfun will hopefully serve as a sensor for changing hue, saturation and brightness. I say hopefully as the device is suffering from a known capacitor problem I have not tried to solve yet. If I can’t get it to work I will have to think about some alternative controlling mechanisms… so called creative work, I guess. Just as this whole thing isn’t about creativity  ; )

monotrilicht – interfacing with Hardware

This is monotrilicht, a single RGB LED driven by an Arduino Pro Mini. It may be seen as a prototype of tinoffifteen. The monotrilicht can change its hue, saturation and brightness with one potentiometer and one single push button.

I really love to see software and hardware interacting. It’s so much fun to see things suddenly move or light up because of code. Lovely! Arduino is a very nice electronics prototyping platform that let’s you easily get involved. This is actually not my first project but it’s one of those I like most.

All sensors on one image. The pushbutton switches through 6 modes, beginning with mode 1 on power up. The potentiometer is used to adjust settings like riding on the 360° on the color wheel or the speed of animation. Between the resistor on the right and the black push button you can see an LDR (light dependent resistor aka photo-resistor). Its value balances the brightness in some modes of operation. The modes are:

  1. adjust hue
  2. adjust saturation
  3. adjust brightness
  4. switch to saved color* that was set in the previous modes
  5. animation** with manual brightness
  6. animation** with manual speed

*fixed color with no reaction on potentiometer

**animation means riding the color wheel by itself, changing its color continuously

Paul V has written a nice function to convert hue, saturation & brightness to RGB values. This function was very helpful to me so I mention it here.

Canned in a tin:

You may see monotrilicht in action in this video(link).