Chit chat


Thanx to the IBM website for having information that helped me solve a cobol issue. Cobol? Yes I run it on an Nslu2 with Debian linux. It just works. In pic formats us z’s to suppress zeros.

Experimenting with some ecg circuits.



Decided to put some old heat sensors work with linux via Digitemp. The command names have changed a bit.

From two of the more popular sites: (note: 25 pin connectors will use different connections.)

Temperature sensing with linux:

You should be able to install digitemp from the repo without have to download the software and manually installing it.

Debian based:
$ sudo apt-get install digitemp

Fedora based:
$ sudo yum install digitemp


$ sudo apt-get digitemp

Once inststalled You can use

$ sudo digitemp_DS9097u -s /dev/ttyUSB0 -w

Now, to read the temperatures. You’ll want the digitemp package, which is pre-packaged in Debian and probably most other Linux distributions. Once it’s installed, you’ll need to know what program to use. Several are available for different DS masters, but in the LinkUSBi’s case, you’ll want digitemp_DS9097U. To begin, verify the bus is working correctly by walking it:

# digitemp_DS9097U -w -s /dev/ttyUSB0
DigiTemp v3.5.0 Copyright 1996-2007 by Brian C. Lane
GNU Public License v2.0 -
Turning off all DS2409 Couplers
Devices on the Main LAN
28D1483C0200002F : DS18B20 Temperature Sensor
28E9393C020000C3 : DS18B20 Temperature Sensor
010EBED512000046 : DS2401/DS1990A Serial Number iButton

This shows the two DS18B20 temperature sensors (T-Sense probes), as well as the DS2401 embedded in my LinkUSBi. (The DS2401 literally does nothing but return a serial number. Still, as mentioned before it’s useful to have to verify the bus is working correctly even if no other devices are plugged into it.)

Next you’ll want to create a config file. I chose to store it in /etc/digitemp.conf.

# digitemp_DS9097U -i -c /etc/digitemp.conf -s /dev/ttyUSB0
DigiTemp v3.5.0 Copyright 1996-2007 by Brian C. Lane
GNU Public License v2.0 -
Turning off all DS2409 Couplers
Searching the 1-Wire LAN
28D1483C0200002F : DS18B20 Temperature Sensor
28E9393C020000C3 : DS18B20 Temperature Sensor
ROM #0 : 28D1483C0200002F
ROM #1 : 28E9393C020000C3
Wrote /etc/digitemp.conf

You will be left with a file called /etc/digitemp.conf that looks something like this:

TTY /dev/ttyUSB0
LOG_FORMAT "%b %d %H:%M:%S Sensor %s C: %.2C F: %.2F"
CNT_FORMAT "%b %d %H:%M:%S Sensor %s #%n %C"
HUM_FORMAT "%b %d %H:%M:%S Sensor %s C: %.2C F: %.2F H: %h%%"
ROM 0 0x28 0xD1 0x48 0x3C 0x02 0x00 0x00 0x2F 
ROM 1 0x28 0xE9 0x39 0x3C 0x02 0x00 0x00 0xC3

You can rearrange the ROM mappings as you’d like. 1-Wire refers to devices by their 64-bit IDs; the numeric mappings are for digitemp’s benefit. In my case, 28D1483C0200002F is the probe I’d like to use, so #0 is fine.

Now, let’s see what’s being returned:

# digitemp_DS9097U -q -c /etc/digitemp.conf -a
Mar 04 22:22:43 Sensor 0 C: 25.38 F: 77.67
Mar 04 22:22:44 Sensor 1 C: 27.56 F: 81.61

Great, works fine. We’ll soon need the data in a machine-readable format, so here’s how to do that:

# digitemp_DS9097U -q -c /etc/digitemp.conf -o 3 -a
0	77.79	81.50


Yet another antenna: (unmounted)



Learning electronics. This was the first kind of circuit I ever put together. Decided to recreate it the astable multivibrator. Discrete parts can be a bonus sometimes.


Parts used:

2 – leds (different colors adds more mystique)
2 – 330 ohm resistors
2 – 10k ohm resistors
2 – 2n2222 transistors (npn)
2 – 100uf  50v Electrolytic capacitors
1 – 3 volt battery

Blinks fairly fast. You can exhange parts to see what it can do. The actual circuit:

What should happen: (different circuit, but essentially the same still using npn transistors.)


 Working on a microcontrolled audio switcher you can access from the web. Still have to add 32 audio lines.
Dear #Ubuntu. Some of us use command line only machines. so the loss of alsamixer is a reaL PAIN. Gnome-alsamixer is useless for us. Guess i will have to look for the source and compile it for the system. Or just wait and  replace u12.04 with a real linux.
Recently upgraded the server to U12.04. Would have prefered to replace it with something else, but there are too many web applications to reinstall. The upgrade seemed to go well. Now that have had a chance to use the machine, there apps missing that WERE installed before the upgrade. So now if is a matter of reinstalling some programs.
Like to use the system without a gui. that is everything is done from the command line. That might seem like a pain, but it really is easier. That is especially tru if you have a lot of jobs scripted as we do. Went to fire up some music to play from the server (speakers are attached). All  I got was an error.  Ugh,,,,
First thing to do is to check for the sound card.
$ alsactl init
Got an error of no card. Then tried to run alsamixer. it was no longer installed after the upgrade.
For grins, I tried to get some speech but that failed also.
$ echo I love Rita | festival –tts
Started to install pulseaudio, but thought better of it. Went  over to the server to see if the sound card was still installed.  It looked like it was till I looked closer. Some how the daughterboard that hols the sound card had come loose. Ugh, Shut the machine down and reinstalled the daughterboard. Restarted the system.
$ alsactl init
Found hardware: “CMI8738” “CMedia PCI” “” “0x13f6” “0x0111”
Hardware is initialized using a generic method
That was a good sign.
Then I tried to play a song or too but mplayer was not installed. Went and reinstalled it. Had it before the upgrade. Now to try again.
$  mplayer Light*
At last sound…..
Then I realized the path command was abreviated as it did not have my local bin directory included in the path. Time to fix that.
$ echo $PATH
$ export PATH
$ echo $PATH
Retested the voice synthesis and now the computer talks again. Great for use to let you know issues for good things about the system,
$ echo I love Rita | festival –tts
Resintalled Freebasic and compiled some programs that control led’s on the parallel port. updated a few html pages to reflect the use of the programs.
Time to go watch some football.
Musical arduino.(from

Play a Melody using the tone() function

This example shows how to use the tone() command to generate notes. It plays a little melody you may have heard before.

Hardware Required

  • Arduino board
  • 8 ohm “small” speaker
  • 100 ohm resistor
  • hook-up wire


image developed using Fritzing. For more circuit examples, see the Fritzing project page

Connect one terminal of your speaker to digital pin 8 through a 100 ohm resistor. Connect the other terminal to ground.


click the image to enlarge


The code below uses an extra file, pitches.h. This file contains all the pitch values for typical notes. For example, NOTE_C4 is middle C. NOTE_FS4 is F sharp, and so forth. This note table was originally written by Brett Hagman, on whose work the tone() command was based. You may find it useful for whenever you want to make musical notes.

The main sketch is as follows:

Plays a melodycircuit:
* 8-ohm speaker on digital pin 8created 21 Jan 2010
modified 30 Aug 2011
by Tom IgoeThis example code is in the public domain.

#include “pitches.h”// notes in the melody:
int melody[] = {

// note durations: 4 = quarter note, 8 = eighth note, etc.:
int noteDurations[] = {
4, 8, 8, 4,4,4,4,4 };

void setup() {
// iterate over the notes of the melody:
for (int thisNote = 0; thisNote < 8; thisNote++) {

// to calculate the note duration, take one second
// divided by the note type.
//e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
int noteDuration = 1000/noteDurations[thisNote];
tone(8, melody[thisNote],noteDuration);

// to distinguish the notes, set a minimum time between them.
// the note’s duration + 30% seems to work well:
int pauseBetweenNotes = noteDuration * 1.30;
// stop the tone playing:

void loop() {
// no need to repeat the melody.

The paste in the following code into pitches.h  then save to a folder.  Then import the folder into the libraries. :

* Public Constants
#define NOTE_B0  31
#define NOTE_C1  33
#define NOTE_CS1 35
#define NOTE_D1  37
#define NOTE_DS1 39
#define NOTE_E1  41
#define NOTE_F1  44
#define NOTE_FS1 46
#define NOTE_G1  49
#define NOTE_GS1 52
#define NOTE_A1  55
#define NOTE_AS1 58
#define NOTE_B1  62
#define NOTE_C2  65
#define NOTE_CS2 69
#define NOTE_D2  73
#define NOTE_DS2 78
#define NOTE_E2  82
#define NOTE_F2  87
#define NOTE_FS2 93
#define NOTE_G2  98
#define NOTE_GS2 104
#define NOTE_A2  110
#define NOTE_AS2 117
#define NOTE_B2  123
#define NOTE_C3  131
#define NOTE_CS3 139
#define NOTE_D3  147
#define NOTE_DS3 156
#define NOTE_E3  165
#define NOTE_F3  175
#define NOTE_FS3 185
#define NOTE_G3  196
#define NOTE_GS3 208
#define NOTE_A3  220
#define NOTE_AS3 233
#define NOTE_B3  247
#define NOTE_C4  262
#define NOTE_CS4 277
#define NOTE_D4  294
#define NOTE_DS4 311
#define NOTE_E4  330
#define NOTE_F4  349
#define NOTE_FS4 370
#define NOTE_G4  392
#define NOTE_GS4 415
#define NOTE_A4  440
#define NOTE_AS4 466
#define NOTE_B4  494
#define NOTE_C5  523
#define NOTE_CS5 554
#define NOTE_D5  587
#define NOTE_DS5 622
#define NOTE_E5  659
#define NOTE_F5  698
#define NOTE_FS5 740
#define NOTE_G5  784
#define NOTE_GS5 831
#define NOTE_A5  880
#define NOTE_AS5 932
#define NOTE_B5  988
#define NOTE_C6  1047
#define NOTE_CS6 1109
#define NOTE_D6  1175
#define NOTE_DS6 1245
#define NOTE_E6  1319
#define NOTE_F6  1397
#define NOTE_FS6 1480
#define NOTE_G6  1568
#define NOTE_GS6 1661
#define NOTE_A6  1760
#define NOTE_AS6 1865
#define NOTE_B6  1976
#define NOTE_C7  2093
#define NOTE_CS7 2217
#define NOTE_D7  2349
#define NOTE_DS7 2489
#define NOTE_E7  2637
#define NOTE_F7  2794
#define NOTE_FS7 2960
#define NOTE_G7  3136
#define NOTE_GS7 3322
#define NOTE_A7  3520
#define NOTE_AS7 3729
#define NOTE_B7  3951
#define NOTE_C8  4186
#define NOTE_CS8 4435
#define NOTE_D8  4699
#define NOTE_DS8 4978


Did some more work on the Raspberry Pi PC AT makde the power connector and started on the audio/video connectors,’



Good old hotdogs,


Good day,