Slug as an mediaplayer

Submitted bypatrik onSat, 2008-09-06 00:41

Just some notes, see for more. The idea here is to have the Slug playing a audiostream, which contents are controlled by a server (where the media files resides).

-The Slug runs a media player software (mpd) that's set to play a stream from a local server

-The server runs Icecast, which in turn are fed from mpd.

-By changing what mpd and the server is playing the Slug plays different music.

To play another location:

rm mpd_playlist # Remove playlist link

mikroC and the DLR3416

Submitted bypatrik onWed, 2008-08-06 15:24

Some example code for mikroC, PIC16F73 and the 4-digit display DLR3416.

Uses extosc @ 20Mhz.

A0-A1 : RC0-RC1 (address, 1-of-4)
WR : RC2 (write pulse)
D0-D6 : RB0-RB6 (7 databits)

Inspired by Jan-Erik Söderholms asm-code for DLR3416

void toggle_wr();

#define DLR3416_A0 PORTC.F0
#define DLR3416_A1 PORTC.F1
#define DLR3416_WR PORTC.F2
#define DLR3416_DATA PORTB
#define led PORTC.F7

void main() {

char pos = 0;
char Char = 0;

Fast booting Linux PC

Submitted bypatrik onFri, 2008-04-11 17:41

This is a little project to create a fast booting Linux PC. As usual it will as long as possible use parts that I have lying around, I don't like to buy things if I already have usable parts.

The use for the PC is mainly as a TV, and as we only have digital broadcasting in Sweden DVB support is crucial. The components to be used are:

  • Mainboard - a small 17x17cm from an old Thin Client. Has 4x USB, tv-out and some more goodies.
  • PSU - Modified ATX with a 12cm fan which doubles as CPU fan.
  • 256 megabyte RAM

SciTE tips

Submitted bypatrik onThu, 2008-03-27 18:50

SciTE is a nice free multiplatform editor, mostly for coders. It's a bit tricky to configure though, so here are some hints.

1/ PHP-files as source
When you click 'Open' and the file open dialog is shown there is a filter activated to only show source-files. This filter doesn't include PHP files, which is bad for me :)
The solution:
Start with making the global configuration file writable:

sudo chmod 777 /usr/share/scite/

Next, open the file in SciTE by choosing Options/Open Global Options File. Find the filter settings:

Heat controlled fan

Submitted bypatrik onThu, 2008-02-21 18:47

A fan that will be mounted in a ventilation hole. If the temperature rises over a limit the fan will start and run until the temperature is under a certain point. Although the fan is extremely quiet a LDR is used to keep the fan quiet at night.

Status: Has been running without problems for two years. The fan is so quit and nights can be hot so the LDR is not used.


Code (for mikroC):

#define fan GPIO.GP5

int potTemp, potTime, light, temp;

long int delayTime;

void main() {

My Slug

Submitted bypatrik onWed, 2008-01-23 01:18

The Slug is a little NAS-device that can be tweaked to do almost anything. This is a presentation my Slub and what is does (and will do in the future).

Operating System
Debian Arm installed on a 40Gb, 2,5" harddisk connected via USB

Instead of the built in ethernet I use a DLink DWL-G122 wireless usb adapter.

Internet radio
This is the main usage for my Slug. It plays some stations with MPD, some with VLC from a local server.

Light control