Author: scruss

  • The HP48: the best calculator ever

    We had an unscheduled overnight stop in East Lansing last week, and I took the chance to visit the MSU Surplus Store.  For $15, they had HP48G calculators, seemingly unused:

    hp48gThey still have a bunch of them: HP 48G Graphic Calculator.

    They’re maybe not the quickest (the 4 MHz Saturn processor chugs sometimes, and wanders off to clean up memory when it feels like it), the display is downright chunky these days, but they have everything that a scientific calculator should have. The keys have a good action. It just works. Yes, your smartphone has hundreds of times the processing power, but it’s not specialized to the task. The HP48 is.

    If you’re feeling really nerdy, you can run an HP48 (a GX, not the G which I have) under Linux using x48. Jeff has some useful tips on installing x48 on newer ubuntu versions (though you don’t have to do the font thing under Ubuntu 13.10).

    x48Building it is a small matter of ./autogen.sh ; ./configure ; make ; sudo make install.  To run it, you’ll need to install the GX ROM image to ~/.hp48.  The first time you run it, I’d recommend running it from the terminal with:

    x48 -connFont -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-16 -smallFont -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-16 -mediumFont -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-16 -largeFont -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-16 -reset -initialize -rom ~/.hp48/rom

    as the ROM format has an outdated config file which causes it to complain weakly every time you start the emulator.

    Scanned manuals are available from HP and archive.org here: HP 48g User Guide, HP 48g Quick Start Guide.

  • It’s a shame about Ray …

    It’s a shame about Ray …

    Instagram filter used: Lo-fi

    Photo taken at: Ripley’s Aquarium of Canada

    View in Instagram ⇒

  • Trippin’ with the Alewives

    Trippin’ with the Alewives

    Instagram filter used: Lo-fi

    Photo taken at: Ripley’s Aquarium of Canada

    View in Instagram ⇒

  • Processing 2.1 + Oracle Java + Raspberry Pi + Serial + Arduino = ☺

    Hey! This is very old and there’s an officially supported version out now coming out very soon.

    Update for Raspberry Pi 2/Processing 2.2.1/Processing 3.0.5: Raspbian now ships with Java 8, and Processing only likes Java 7. oracle-java7-jdk is still in the repos, so install that, and follow the instructions below. It’s a bit flakey, but when it runs, runs quite fast on the Raspberry Pi 2. You might have more luck running Processing.js or p5.js in the browser.

    With Sun Oracle hardfloat Java now available, Processing now runs at a decent clip on the Raspberry Pi. My old instructions are now very obsolete. Here are current, tested instructions for installing it under Raspbian.

    [This is a particular solution to installing a Serial/Firmata-enabled Processing 2.1 distribution on a Raspberry Pi. Processing still has issues with other aspects of visual programming (particularly video) that I’m not addressing here.]

    A lot of software is installed here, and much of it depends on previous steps. Don’t jump in mid-way and expect it to work.

    Update the system

    Always a good plan if you’re doing major upgrades:

    sudo apt-get update
    sudo apt-get dist-upgrade

    Install Sun Oracle Java

    sudo apt-get install oracle-java7-jdk

    Check if the right version is installed as default: java -version should give

    java version "1.7.0_40"
    Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
    Java HotSpot(TM) Client VM (build 24.0-b56, mixed mode)

    If you get anything else, you need to make Sun Oracle’s version the default:

    sudo update-alternatives --config java

    Download & Install Processing

    Go to Download \ Processing.org and get the Linux 32-bit version.  It’s big; about 100 MB. I’m going to install it in my home directory, so the base path will be ~/processing-2.1. Extract it:

    tar xvzf processing-2.1-linux32.tgz

    Now you have to remove the included x86 Java runtime, and replace it with the Raspberry Pi’s armhf one:

    rm -rf ~/processing-2.1/java 
    ln -s /usr/lib/jvm/jdk-7-oracle-armhf ~/processing-2.1/java

    You should now have a Processing installation that will run, but there’s some more we need to get serial and Arduino support.

    Install the  java Simple Serial connector

    Download jSSC-2.6.0-Release.zip and extract it:

    unzip jSSC-2.6.0-Release.zip

    Now overwrite the jssc.jar that ships with Processing with the one you just downloaded:

    mv jSSC-2.6.0-Release/jssc.jar ~/processing-2.1/modes/java/libraries/serial/library/

    (You can remove the jSSC folder now: rm -r jSSC-2.6.0-Release)

    Test Processing’s serial support

    You’re almost there! Fire up Processing:

    ~/processing-2.1/processing

    and try Perhaps the World’s Most Boring Processing Sketchâ„¢:

    // Example by Tom Igoe
    
    import processing.serial.*;
    
    // The serial port
    Serial myPort;
    
    // List all the available serial ports
    println(Serial.list());
    

    Screenshot from 2014-01-07 20:08:32When this runs (it’s a little slow), you should get a single line of output, which should start /dev/tty___:

    /dev/ttyACM0

    (I have an Arduino Leonardo attached, which usually appears as an ACM device.)

    Installing Arduino/Firmata support

    (I’m not going to go into uploading Firmata onto your Arduino here. All I can recommend is that you use the newest version at firmata/arduino, rather than the old code bundled with your Arduino distribution.)

    Exit Processing, and download processing-arduino.zip from firmata/processing. Extract it into your Processing sketchbook:

    unzip processing-arduino.zip -d ~/sketchbook/libraries/

    For tedious reasons, you also have to rename one of the files:

    mv  ~/sketchbook/libraries/arduino/library/Arduino.jar  ~/sketchbook/libraries/arduino/library/arduino.jar

    Start up Processing again, and  save Most Probably the World’s Second Least Interesting Processing Programâ„¢:

    import processing.serial.*;
    import cc.arduino.*;
    Arduino arduino;
    int ledPin = 13;
    
    void setup()
    {
      println(Arduino.list());
      arduino = new Arduino(this, Arduino.list()[0], 57600);
      arduino.pinMode(ledPin, Arduino.OUTPUT);
    }
    
    void draw()
    {
      arduino.digitalWrite(ledPin, Arduino.HIGH);
      delay(1000);
      arduino.digitalWrite(ledPin, Arduino.LOW);
      delay(1000);
    }
    

    Screenshot from 2014-01-07 21:13:54
    What this sketch does is emulate the µC’s “Hello World” program, Blink. It flashes the board’s LED once per second. Boring? Yes. But if it worked, you have a working Processing 2.1 installation on your Raspberry Pi. Go forth and make more interesting things.
    (Props to bitcraftlab/wolfing for the basic outline for installing Processing, and for samaygoenka for the prodding needed to update and test the Processing installation process. If you’re still stuck, the Processing 2.0 Forum and the Raspberry Pi Forum are good places to ask.)

  • The Reel Thing

    The Reel Thing

    Instagram filter used: Lo-fi

    View in Instagram ⇒

  • Pretty cold

    Pretty cold

    Instagram filter used: Lo-fi

    View in Instagram ⇒

  • Spike, the Left Bank Books cat

    Spike, the Left Bank Books cat

    Instagram filter used: Lo-fi

    Photo taken at: Left Bank Books

    View in Instagram ⇒

  • and all the world is donut-shaped …

    and all the world is donut-shaped …

    Instagram filter used: Lo-fi

    Photo taken at: LaMar’s Donuts

    View in Instagram ⇒

  • College Lights

    College Lights

    Instagram filter used: Lo-fi

    Photo taken at: William Jewell College

    View in Instagram ⇒

  • meat

    meat

    Instagram filter used: Lo-fi

    Photo taken at: Sugarfire Smoke House

    View in Instagram ⇒

  • Introducing RAFTP: the Really Annoying File Transfer Protocol

    I would like to describe a new and highly impractical method of transferring data between computers. Modern networks are getting more efficient every year. This protocol aims to reverse this trend, as RAFTP features:

    1. Slow file transfers
    2. A stubborn lack of error correction
    3. The ability to irritate neighbours while ensuring inaccurate transmission through playing the data over the air using Bell 202 tones.
    doge-small-tx
    Figure 1

    Figure 1 shows a test image before it was converted into PGM format. This was then converted into an audio file using  minimodem:

    minimodem --tx -v 0.90 -f doge-small-1200.wav 1200 < doge-small-tx.pgm

    This file was then transferred to an audio player. To ensure maximal palaver, the audio player was connected to a computer via a USB audio interface and a long, minimally-shielded audio cable. The output was captured as mp3 by Audacity as this file: RAFTP-demo

    The mp3 file was then decoded back to an image:

    madplay -o wav:- RAFTP-demo.mp3 | minimodem --rx -q -f - 1200 | rawtopgm 90 120 | pnmtopng > doge-small-rx.png

    Figure 2 shows the received and decoded file:

    Figure 2
    Figure 2
  • Full steam, Mr Butler, and damn the consequences

    Full steam, Mr Butler, and damn the consequences

    Instagram filter used: Lo-fi

    Photo taken at: David Pecaut Square

    View in Instagram ⇒

  • teh p0inty

    teh p0inty

    Instagram filter used: Lo-fi

    Photo taken at: Clarence Square Park

    View in Instagram ⇒