I seem to remember this being like the logo of every Amiga software company ever

I seem to remember this being like the logo of every Amiga software company ever

I seem to remember this being like the logo of every Amiga software company ever

… except I just made it in OpenSCAD:

// 12-sided box flower - scruss, 2017

// uses HSV library
//  from https://www.thingiverse.com/thing:279951
//   function hsvToRGB(h, s, v, a)
use <hsvtorgb.scad>;

r = 10;
ulx = r * cos(60);
uly = r * sin(60);
lrx = r * cos(30);
lry = r * sin(30);
side = lrx - ulx;

for(j = [0:11]) {
    for(i = [0:11]) {
        color(hsvToRGB(i / 12, 1, (24 - j) / 24, (48 - j) / 48)) {
            rotate(j * 15) {
                scale(pow(sqrt(2), j)) {
                    rotate(i * 30) {
                        translate([ulx, lry]) {
                            square(side);
                        }
                    }
                }   
            }       // a simple  joy that
        }           // python programmers
    }               // will  never   know
}

View in Instagram ⇒

Despite a reputation for mechanical problems, the extended version established itself as the market leader

Despite a reputation for mechanical problems, the extended version established itself as the market leader

Despite a reputation for mechanical problems, the extended version established itself as the market leader

Instagram filter used: Normal

View in Instagram ⇒

More rainbows from silicon chips

More rainbows from silicon chips

Picked up at Junk Independence Day, these are unencapsulated silicon chips. You can make out the solder pads around the top edges, and I think the two solid blocks are PROM storage. The chips are supposedly Mosel MSS1002-14T speech generator ROMs from 1991.

To give an idea of scale, the outside walls of each cell are 3.8 mm / 0.15ʺ.

Here’s another photo, taken through a very cheap 8× loupe with a cellphone camera:
Silicon Rainbow

Simple — like, really simple — Arduino periodic timer with Brett’s MillisTimer library

I don’t know how many times I’ve written bad Arduino code to call a function every few milliseconds. Sometimes this bad code works well enough for my sketch to actually work. Often, it either doesn’t work at all or does something I really didn’t expect.

So on Arduino Day 2017, I’m glad I found out about bhagman/MillisTimer: A Wiring and Arduino library for working with millis(). It couldn’t be simpler to use: include the library, write the function you want to call every N milliseconds, set up the timer to run every N millis, and put timer.run() in a loop that’s called frequently. The library handles the timing and resetting all by itself.

As an example, here’s the eternal “Hello, World!” of the embedded world, Blink, rewritten to use MillisTimer:

// MillisTimerBlink - blink LED every second
//  using Brett Hagman's MillisTimer library
//  https://github.com/bhagman/MillisTimer
//  (or use Sketch → Include Library → Manage Libraries … to install)
// scruss - 2017-04-01

#include <MillisTimer.h>
MillisTimer timer1;               // new empty timer object
const int led_pin = LED_BUILTIN;  // use the built-in LED

void flash() {                    // function called by timer
  static boolean output = HIGH;
  digitalWrite(led_pin, output);  // set LED on or off
  output = !output;               // toggle variable state High/Low
}

void setup() {
  pinMode(led_pin, OUTPUT);       // use built-in LED for output
  timer1.setInterval(1000);       // set timer to trigger every 1000 millis
  timer1.expiredHandler(flash);   // call flash() function when timer runs out
  timer1.setRepeats(0);           // repeat forever if set to 0
  timer1.start();                 // start the timer when the sketch starts
}

void loop() {
  timer1.run();                   // trigger the timer only if it has run out
  // note that run() has to be called more frequently than the timer interval
  //  or timings will not be accurate
}

Note that MillisTimer only triggers when timer.run() is called. Sticking a delay(2000) in the main loop will cause it to fire far less frequently than the interval you set. So it’s not technically a true periodic timer, but is good enough for most of my purposes. If you want a true interrupt-driven timer, use the MsTimer2 library. It relies on the timer interrupts built into the Arduino hardware, and isn’t quite as easy to use as MillisTimer.

μ̈ — the net-connected cowbell for your Internet of Tings … #arduinod17

μ̈ — the net-connected cowbell for your Internet of Tings … #arduinod17

View in Instagram ⇒

Keypunch029 — for all your punched card font needs …

A fairly accurate rendition of the 5×7 dot matrix font printed at the
top of punched cards by the IBM Type 29 Card Punch (1965).

Local copy: Keypunch029.zip.
Fontlibrary link: Keypunch029

The 029 (as it is sometimes known) generated a bitmap font from an engraved metal plate pressing on a matrix of pins. A picture of this plate from a field engineering manual was used to re-create the pin matrices, and thus an outline font.

029 Code Plate
029 Code Key

Historical Accuracy

The 029 could have many different code plates, but the one used here contained the characters:

<=>¬|_-,;:!?/.'"()@¢$*&#%+0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ

The character glyphs have been sized such that if printed at 12 points, the 029’s character pitch of 0.087″ is accurately reproduced. No attempt to research the pin matrix pitch or pin diameter has been made: the spacing was eyeballed from a couple of punched cards in my collection.

The earlier IBM Type 26 Card Punch (“026”) included a glyph for a square lozenge (Unicode U+2311, ⌑). The 029 code plate did not include this character, but I added it here for completeness.

The character set was extended to include:

  • all of ASCII, with lower case characters repeating the upper case glyphs;
  • sterling currency symbol; and
  • euro currency symbol.

While there may have been official IBM renditions of some of these additional glyphs (with the exception of euro) no attempt has been made to research the original shapes. This font set is intended to help with the visually accurate reproduction of 1960s-era punched cards, mostly coinciding with my interest in the FORTRAN programming language. No attempt has been made to use historical BCD/EBCDIC encodings in these fonts. We have Unicode now.

The 029 card punch could not produce any bold or italic font variants, but FontForge can, so I did.

Things I learned in making these fonts

  1. The 029 card punch printer could be damaged if you tried to print binary cards, as there was no way to disengage the code plate from the punch mechanism.
  2. FontForge really hates to have paths in a glyph just touching. Either keep them more than one unit apart, or overlap them and merge the overlapping paths.
  3. EBCDIC is weird.

Sources