When you use the online USPS shipping label generator (we use it via paypal), it generates a full page of information. The top half of the page is the label you affix to the package, and the other half is full of extra info that isn’t needed for the shipping label. If you want to use full-page label sheets, you really don’t want to waste half the page each time you print a label. To work around this, we developed a script to split a PDF into top- and bottom-half PDFs, enabling you to only print the top half (the actual label) while leaving the bottom half of the label page usable for the next label you print.
For example, here’s a slightly-doctored image of the original printing label. I have highlighted the actual label, and darkened out everything else:

The script below is used to split that PDF document into two smaller documents, one each for the upper and lower half. We have only tested it on Linux, but it might work on windows or Mac OS if you have the right tools installed (ghostscript).
#!/bin/bash
# A script used to split USPS shipping labels into two pages,
# so you can print the label without wasting the other half.
# Written by Matthew Beckler, for Wayne and Layne, LLC
# wayneandlayne at wayneandlayne dot com
# Last Updated: January 23, 2011
#
# This is what GS told me the original PDF size was
# Page 1 MediaBox: [ 612 792 ]
# Output produced from this command:
# gs -dNODISPLAY -q -sFile=input.pdf -dDumpMediaSizes \
# -dDumpFontsUsed -dShowEmbeddedFonts pdf_info.ps
# which uses the file "pdf_info.ps" from the GS source code.
BASENAME=`basename "$1" .pdf`
gs -o "${BASENAME}_label.pdf" -sDEVICE=pdfwrite -g6120x3960 -c \
"<</PageOffset [0 -399]>> setpagedevice" -f "$1"
gs -o "${BASENAME}_info.pdf" -sDEVICE=pdfwrite -g6120x3960 -c \
"<</pageOffset [0 0]>> setpagedevice" -f "$1"
You can easily use this script to split a PDF into two halves by passing in the name of the PDF document as the first and only argument:
./split_usps_shipping_label.sh shipping.pdf
The script will create two files: shipping_label.pdf and shipping_info.pdf (it’s based on the name of the file you specified).shipping_label.pdf will be a half page containing only the upper-half of the original document, and can be directly printed without wasting the other half of the full-page label.
Many thanks to Wayne and Layne forum member Pascal König for sharing his tic-tac-toe game for the Video Game Shield! It features two player support, nice graphics, solid gameplay, and easily understood code. A screenshot is shown below, and the new code is available, as always, on the Video Game Shield download page, as well as in our github repository.

Open Source Hardware Logo in Kicad
Today, the open source hardware logo was chosen via poll.
Wayne and Layne uses and loves Kicad, an open source ECAD program for laying out our PCBs. A while ago, we wrote an open source web and standalone app called img2mod that can convert images to Kicad modules, suitable for putting on silkscreen layers (or copper or anything else).
This afternoon, I took a few minutes and put a few different sizes of this logo into a library that anyone can include in their Kicad project and brand their PCB as open source hardware.
So, if you’d like to make your PCBs with an open source PCB layout tool, we heartily recommend Kicad (although we hear geda is pretty good too).
The logo library is up on our github, in a new Open-Source-Hardware-Logos-for-Kicad repository.
Note: we haven’t tried these yet (it’s only been official since this morning!), but we’ll continue to refine them as we try them on real boards.
BP20422 Breakout Board
We were recently contacted by Jeff Rowberg, who’s working on the very cool Keyglove project, about our previous work with the BP20422 bluetooth module breakout board. He was looking for a breakout board similar to what we were doing, but was interested in a breadboard-compatible version. Wayne and Layne quickly whipped up a new breadboard-compatible version of the breakout board. Jeff wrote up a great blog post about the new breakout board, and his experiences with slightly-different modules.

We’ve received a few messages asking if we’re selling the breakout boards, or if the design files are available anywhere. We’ve decided to release the design as open source hardware, much like our other kits. While we aren’t selling them as kits right now (we may in the future) here is a ZIP archive of the Kicad design files for the schematic and PCB:
If you’re interested in getting this PCB fabricated, we highly recommend the most-excellent PCB service offered by @laen.
Here’s the Bill of Materials (BOM) for the circuit board, with links to the mouser part we’ve used in the past (only for non-standard parts):
| Quantity | Description | PCB label | ||
| 1 | 330 ohm resistor | R1 | ||
| 1 | 2.2 uF capacitor | C1 | ||
| 2 | 10k ohm resistor | R2, R3 | ||
| 2 | 0.1 uF ceramic capacitor | C2, C3 | ||
| 2 | 68 uF electrolytic capacitor | C4, C5 | ||
| 1 | BP20422 module | U1 | ||
| 1 | Blue LED | D1 | ||
| 1 | 6 mm pushbutton switch | SW1 | ||
| 48 | Standard 0.1″ header pins | P1-P6 |
Update: Thanks to Jeff for leaving a comment with a link to a better capacitor that will fit better on the PCB. Thanks, Jeff!
Early adopters of the new Arduino UNO and Arduino Mega 2560 using the Linux operating system seemed to have a number of bizarre issues with the serial port connectivity. Fortunately, the Arduino team just released a new firmware patch for the little ATmega8U2 microcontroller that handles the serial communications. They wrote up some great photos and instructions on how to re-flash your Arduino UNO. but they don’t have any information or photos for the Mega 2560.
Well, tonight I looked at the Mega 2560 schematic and PCB layout files in Eagle, and figured out what I needed to do to properly reset the 8U2 serial port chip to enable the “DFU” programming mode. The general idea is to reset the chip while shorting two pads on the backside of the circuit board. The two pads you need to short are in a different location on the Mega than the UNO, and are highlighted in the image below in green. The other two pads you need to short are highlighted in red.

You’re going to want to follow the guide posted for installing the Linux/OSX/Windows DFU programming software, and the rest of the re-programming process. This page shows the procedure for resetting your Arduino Mega 2560 into DFU programming mode. This procedure is as follows:
- Plug your Mega into the computer as normal, using the USB cable.
- Using a piece of wire or a screwdriver tip, short out the pads above circled in green. Keep them shorted out until the end.
- Using another piece of wire or another screwdriver, short out the pads above in red.
- Stop shorting out the red pins.
- Stop shorting out the green pins.
Now, if you check in your Arduino menu, the board’s serial port should no longer show up in the menu. You can now follow the rest of the guide on re-flashing your 8U2 serial port firmware with the latest version.
The Open Source Hardware Definition hit 1.0 this morning. Awesome! We’ve been behind Open Source Hardware since we started–all our kits are open source hardware. We sponsored the Open Source Hardware Summit in September, and we’re really believers in it.
Piggybacking on the news, however, I’d like to start a discussion.
In September, we launched our Video Game Shield kit. It’s an Arduino shield that allows you to use two Wii peripherals and draw in black and white on a television screen. It uses the open source TVOut library. A little bit later, nootropic designs released their Hackvision. The Hackvision is a handheld board that combines the guts of an Arduino with some RCA jacks. It uses the Arduino IDE for programming along with the TVOut library. It has some buttons built in and an expansion port for wiring in your own controllers.
So, because his system uses Arduino and TVOut libraries, it’s relatively easy to get his games to run on a Video Game Shield. You need to change some pin definitions, and maybe make a few more changes, but they’re extremely minor.
Due to the fact that most Video Game Shield games use both Wii connectors, it isn’t quite as easy to get our games to run on a Hackvision, but for single player Video Game Shield games, it’s just as easy to convert our games to run on the Hackvision.
We’ve talked with the Hackvision folks about putting their games on our site, but this situation raises a lot of questions.
All the Video Game Shield and Hackvision “official” games are open source, and we’re pretty sure we’d be legally ok modifying the Hackvision games and posting them on our website. We *haven’t*, and we don’t really have any plans to, but would it be alright if we did? Should we? If someone else did, should we link to them?
If the blog comments get to be overwhelming, we can move this over to the Wayne and Layne forum.
Beta test for Wayne and Layne!
Free hardware!
We’re looking at producing some of our upcoming kits in vast vast numbers (for us), and to reduce our risk, we want to get the hardware in a bunch of people’s hands to see what they think.
We hope to send out some hardware to folks within a few weeks, have them build our kit, play with it for a little bit, and then have them give us some feedback.
The kits are blinky and awesome, and should take less than an hour to assemble and less than half an hour to play with.
To do so, we made a little form for folks to apply. Don’t feel intimidated by the questions–we’re looking for a wide batch of folks, not just the ones with the most experience.
We’re looking to make our decisions soon, so don’t delay! The form shouldn’t take more than a few minutes to fill out.
We recently received quite a lot of requests for a video game that doesn’t need Wii controllers. This afternoon I took ten minutes and adapted our popular two-player PONG game to use two potentiometers as controllers, instead of the Wii Nunchucks. The potentiometers will be connected to the Arduino’s analog inputs 0 and 1.

I used two trimmer-style potentiometers mounted in a breadboard. These potentiometers have three leads, and the center lead is commonly called “the wiper”. Connect the other two pins to 5v and Ground, and connect the wiper to analog 0 / analog 1. As the potentiometer is turned, the wiper will have a voltage between 0 and 5 volts, which is measured by the Arduino’s analog inputs 0 and 1. These measured analog voltages are then digitized and used to position each player’s paddle.

The new sketch, tv_2p_pong_potentiometers, is now available in our regular library zip, as well as on github.
Arduino Tetris on the Video Game Shield
Myles recently ported an open Tetris clone to the Arduino. We added support for the Nunchuck (so now it works with both the Nunchuck and the Classic Controller) as well as music!
It’s available in our regular library zip, as well as on github.
Buy the Video Game Shield add-on for the Arduino for $22.50 in the Wayne and Layne store today!






