picture home | pixelblog | qt_tools

omino code blog

We need code. Lots of code.
David Van Brink // Thu 2008.11.6 10:44 // {wordpress}

WordPress Pages, Anywhere

Pardon this post which is about technical trivia unrelated to API’s and Weird Blinking Lights. But I needed to jot it down somewhere. It’s a note about including contents out of WordPress in parts of a site which aren’t under the WordPress installation.

Now that WordPress includes revision management (as of 2.6) I intend to use it for the whole site, but I didn’t want to rejigger the install directories. Recipe below the cut.

oh, i dont know. what do you think?

David Van Brink // Mon 2008.10.13 08:57 // {broad generalities future}

Free Idea: New International Power Plug

This morning I woke up doing some dream-design work.

It was about the new international standard power plug. It resembled an American power plug, nonpolarized. The tines were a little bit more widely spaced, and narrower.

The power cord was a little bit thinner and more flexible than normal cords. This was for two reasons. First, the AC current on it was stepped in some exotic way that allowed more effective power over the same conductors than a pure sine wave. Maybe it spreads the frequency out more, and affects the cooling characteristics.

More importantly, the voltage and frequency was negotiated by a tiny chip in the plug itself, with the wall outlet. It’s down in the plug, again, to optimize cord weight.

Presumably the protocol can also carry data.

I’m pretty sure the stuff about the frequency-spread and power capacity makes no sense at all. I am just a software guy. But the rest seemed plausible enough. I do so hate wallwarts.

oh, i dont know. what do you think?

David Van Brink // Tue 2008.09.30 17:01 // {broad generalities java}

Practical API Design by Jaroslav Tulach

Found and acquired this book today at Bookshop Santa Cruz. Very nice tome on good Java API style. Alas, slightly pricey ($75 retail). The fellow’s a bit ranty at times… but, ah, I can relate. The author was a founding architect of NetBeans , and is still a principal on that project.

Also, look, google lets you embed a book for up to 20% reading! (Embedded below, may take a moment to load.)

Search for “beatiful” or “symmetry” or “backwards compatibility”…

oh, i dont know. what do you think?

David Van Brink // Wed 2008.09.24 23:02 // {wbl weird blinking lights}

XBee Untethered

The XBee module has an odd connector. It’s 20 pins in two widely-space rows, with 2mm spacing. Nice and efficient, but doesn’t fit into my gridlike 10th inch world view.

I mean, it’s fine, if you’re spinning a board…

But if you’re just dinking around, it’s nice to have it fit into that 10th inch protoboard world.

Thankfully, Sparkfun Electronics sells little adapter boards and the exotic 2mm-spacing female headers. A breakout board and all the connectors runs about $5.50 from them. (From Digikey, just the 2mm female headers are, like, $4.00 each. Sometimes their pricing confuses me.)

Here’s an XBee module connected to 3v, and a resistor, and an LED, and nothing else. Boots into receive-mode, and the led blinks in response to a button on a second module.

Also, bonus points to Sparkfun for shipping my whole order in a single heatsealed baggie in a very small cardboard box by US mail. Valuable service!

oh, i dont know. what do you think?

David Van Brink // Mon 2008.09.15 19:16 // {wbl weird blinking lights}

Fun With XBee

About a year ago, I was vaguely wondering if there were any low cost 802.11-ish WiFi modules, to easily add a net-presence to my dinky electronics doodles. There wasn’t; WiFi modules seem to run around $150 or more. (Which is the same price as a WiFi Kodak picture frame, but that’s parts for ya.) But I came across these $19 “XBee” modules and was intrigued…

XBee modules, from www.digi.com (not digikey), implement an RF protocol called ZigBee, 802.15.4. It can run at various power levels, up to about a mile. At 1mW, you get a few rooms coverage. An XBee transmitting at 1mW consumes around 50mA when either receiving or transmitting.

Just recently, on a whim, I got their starter kit which includes two modules mounted on boards, $99.

I have to say, it gave great Out Of Box experience! Just plug one into the USB port, and plug a serial loopback into the other, and fire up their little terminal program, and they’re talking!

So here’s what their $19 module can do:

  • Automatically form a repeater mesh
  • Default mode is a transparent 9600 baud serial party line
  • Can enter “command mode” by sending +++ onto the serial port
  • Can configure the module into different modes with AT-commands (snicker)
  • Can configure a module’s address, take it off the “party line”, and such
  • Has a half-dozen available I/O pins, which can be AT-configured to act as “virtual wires” between modules
  • Use ATWR to save the configuration… powers up identically next time.
  • Requires 3 volts.


The starter kit comes with two boards. The first uses USB for the serial comm port and for power. The second uses a DB-9 with official RS-232 on it, and a 12v adapter. The general purpose I/O lines are just sitting there, without even a header.

Some necessary modifications were in order. I added headers to access the I/O lines. (Pesky wave-solder on the PC board filled in all the holes; clearing them out with a soldering iron, melt-and-slam, works except for the pesky GND, I guess the four layer board’s ground plane is sucking away all my heat.) I contrived a 9v battery to power the remote board. I added some female headers to an LED and a microswitch.

Look, new toys! Some Panavise holders to replace the stupid “Helping Hands Magnifier” from Radio Shack. Sheesh I remember when that looked sooo useful. Also a new soldering iron, with digital readout. ($90 on eBay, search for “tmc soldering iron”, came with two irons and 6 tips, happy with it so far.)

Back To Work

I configured the two boards with a variation of the example in the datasheet:

Module with button:
ATDL 1234 their address
ATMY 5678 my address
ATD0 3 i/o 0 is an input
ATIR 14 sample rate
ATWR save
Module with LED:
ATDL 5678 their address
ATMY 1234 my address
ATD0 4 i/o 0 is an output
ATIU 1 i/o enabled
ATIA 5678 receive i/o commands from
ATWR save

And ho ho! They can talk.


click for

Good clean fun.

oh, i dont know. what do you think?

David Van Brink // Mon 2008.09.15 18:36 // {wordpress}

one more wordpress plugin

Now that I’ve got my subroutines in place, making certain kinds of helpful WordPress plugins is dangerously easy!

I’ve added plugin such that <w w="George Washington"/> becomes a tiny Wikipedia link, like this: .

Pretty cool, huh? Now when I talk about cabbages and kings I can quickly refer you to authoritative information on the subject.

At some point I needs must package up these plugins to make them easier to share; til then, it’s possible at least to hork them from the plugins directory of this blog.

/src/saInfrastructure/wpOverlay/wp-content/plugins/saW_wp.php in new window download /src/saInfrastructure/wpOverlay/wp-content/plugins/saW_wp.php to file hide /src/saInfrastructure/wpOverlay/wp-content/plugins/saW_wp.php

oh, i dont know. what do you think?

David Van Brink // Sun 2008.09.14 18:45 // {code scripting wordpress}

simple browser tricks

In a detour to a detour to some longer term goal, I needed to do some minimal HTML/JavaScript coding. The regularly scheduled hardware and WBL tinkering — including soldering, LEDs, and wireless sensors — will resume shortly.


oh, i dont know. what do you think?

David Van Brink // Sun 2008.09.7 22:01 // {wbl weird blinking lights}

In Memory Of an early WBL

Specimen: a Lazer Tag target, circa 1987, manufactured by Worlds of Wonder, an early commercial WBL if ever there was one.

I’m doing a bit of dejunking and shedding, but wanted to give a moment’s silence for this one. LEDs and speaker and a tiny cpu, delicious. The LEDs would blink back and forth, a little faster each time you hit the target with the IR gun, until it blipped out, dead. Five or six hits, I think.

Some parts I see: LM567, the internets say it’s a tone decoder, probably for IR sensing. The two big black rectangles in the middle are the IR sensors. And I’m guessing the CPU is the TI MP1826N2; no idea what it is.

Me, I’m gutting it for the cool red dome and small speaker.

(From Wikipedia, WoW founder Don Kingsborough with gun and target)

oh, i dont know. what do you think?

David Van Brink // Wed 2008.08.13 19:24 // {wbl weird blinking lights}

The Old Parts

Getting on towards deep self indulgence, here …

oh, i dont know. what do you think?

David Van Brink // Tue 2008.08.12 22:16 // {wbl weird blinking lights}

12f509 cheat sheet

Back in the 80′s, I thought it was the coolest thing that you could call up someone in San Jose, tell them you were interested in such and so category of parts, and they’d send you a great box of literature. I obsessively read the app notes and features of the 8051 and 8048 “single chip microcomputers”, among the 20 pounds of Intel phonebooks. Apart from their undeniable literary value (the signs and signifiers were never closer, and the narrator… such a cypher) they were occasionally of practical value. One day at the local landfill, I came upon a stash of 8748′s (reprogrammable and UV-erasable!) and, guided by the incantations of these tomes, heroically brought those chips to life. But that’s for another post.

Those endless summers of bound and printed datasheets weren’t so endless… Now you have to print your own. On the other hand, you can obtain them any time of the day or night. Progress!

The “data sheet” for one of Microchip’s smallest parts, and my favorite, the 12f509, is still 97 pages long. I have it printed out, of course. But the majority of my inquiries where answered by just a few particular pages. So here are what I found to be the most important bits, extracted into the “Pic 12f509 Single Page Cheat Sheet.”

Raymond // Wed 2008.12.10 09:479:47 am

The most frustrating part about the widely used 12F508/509 is the general lack of published software examples. I want an assembler template and a .inc file for programing. Along with the 12F675 it looks like a usable chip set.

David Van Brink // Thu 2008.12.11 08:428:42 am

Hi Raymond — I haven’t used the ’675 yet. I do love these tiny 8-pinners though.

It’s not comprehensive, but most of my PIC code is viewable at http://omino.com/src/pic/

Look for asm files, like
http://omino.com/src/pic/wbl05bDemocracity/generalBlinker.asm .

Hope that might help, a little. I found the chip pretty straightforward to use, overall.

oh, i dont know. what do you think?

(c) 2003-2011 omino.com / contact poly@omino.com