Adobe Javascript

Pasting paste

Pasting paste

I occasionally create PDF forms for work that would be a lot more useful with just a little bit of logic.  Luckily, PDF’s can run javascript.  To save me from having to continually search for this same information every few months, I’m copying and pasting a piece of an Adobe forum thread here:

// Obtain the value from the first field

var v1 = getField(“balance1”).value;

// Obtain the value from the second field

var v2 = getField(“amount2”).value;

// Set this field value equal to the sum

event.value = v1 + v2;

That should do it.

Photo courtesy of pvera.

A Little Bit of Javascript Goes a Long Way

avengers endgame poster

I use a web based CRM for work, and it’s pretty good.  That said, I wrote a chrome extension to slightly improve it in dozens of small ways.  The cumulative effect of these changes is that I have a quantitively and qualitatively different experience than everyone else using this software.
Working remotely, where so much of the information comes through a web browser, being able to force a website to work the way I prefer feels like an infinity stone level reality warping super power.

How to Reverse Text String in LibreOffice or OpenOffice

After spending a bit of time trying to figure out how to reverse the text in a LibreOffice cell, I found some information from mikekaganski which solved the problem for me.  I find it easier to learn such things with written information rather than a combination of written and video, so I’m reproducing the steps here.

Once LibreOffice is launched:

  1. Tools -> Macros -> Edit Macros
  2. Under “Module 1” copy and paste the code below
  3. Save and close this window
  4. Use the function “=(StrRev(A1))” to reverse the text of A1
Option VBASupport 1
Function StrRev(str As String) As String
StrRev = StrReverse(Trim(str))
End Function

That’s it!

Photo courtesy of Tim Samoff

Building the Monocle Top Hat Cat for #MicrobitVirtualConcert

This slideshow requires JavaScript.

The last few months there have been some pretty amazing little robots posted online for the Tinkering Studio / Exploratorium #MicrobitVirtualConcert.  I wanted to make something and participate and my 6 year old was interested in helping out.  I don’t have a Micro:Bit, but I’ve got a few other microcontrollers and the Adafruit Circuitplayground Express is perfect for this kind of project.

Here was our basic process:

  1. Brainstorm ideas
  2. I eat a frozen pizza and save the cardboard
  3. Sketch of robot – and what it should do
  4. Taping sketch of robot over white cardboard
  5. Tracing sketch with a pencil with enough pressure to leave an indentation
  6. Coloring robot
  7. Measuring / designing a 3D printed plastic part to fit the servo (before I committed more plastic to it)
  8. Scratching my head and jamming together circuitpython code for servos and musical notes together.  I had really wanted to also have the eyes light up with Neopixels too, but…
  9. Ultimately, I had a sketch for lights + musical tones and another for servo + musical tones.  My daughter made the executive decision to go with servo + musical tones. 1
  10. Revising the design to include some “wings” for more surface area to glue to the card board and increase stability
  11. Adding extra “wings” so that the popsicle sticks could pivot on a piece of paperclip in the plastic holder, rather than in the cardboard
  12. “Drilling” holes in the popsicle sticks with drill bits rotated by hand
  13. Gluing in servo holder and just lashing bits of things together in the back with hot glue, blue tape, and some wire
  14. Testing different kinds of tails before gluing the final version in place
  15. The code and STL’s aren’t anything amazing and I didn’t do a lot to comment them.  However, if you might find them useful, I’ve uploaded them to PrusaPrinters.

Here’s the final robot in action:

Companion Robots: Building Robot Friends
  1. Cephalopod Robot Friend, the story so far
  2. Cephalopod Robot Friend Progress
  3. CuttleBot Body and OpenSCAD Design Tips
  4. An Assembled CuttleBot Body
  5. Building the Monocle Top Hat Cat for #MicrobitVirtualConcert
  6. Companion Robots and Maker Faire Season!
  1. What can I say?  In order to bring her onto the project, I had to agree to give her final cut. []

How to Fix Outlook “Get Add-Ins” Grayed Out Button

Work requires a particular Outlook Add-In, but Outlook wasn’t having it.  A bunch of Googling and searching revealed this is because of some esoteric privacy setting that needs to be twiddled.1 Here’s how you fix that:

  1. File > Options > Trust Center > Trust Center Settings > Privacy Options > Privacy Settings2
  2. Check the box “Enable optional connected experiences” and “OK”3
  3. Restart Outlook and you should be able use the “Get Add-Ins” button now

Yay!

  1. This page says what needs to be done – but doesn’t say where to find the necessary privacy settings []
  2. This page explains these options might be limited at the administration level []
  3. This sounds creepy to me. []

QMK: The Adventure Begins

Richard Feynman

Richard Feynman

Noted philosopher / physicist Richard Feynman has a now-famous method for quickly learning a topic.  It boils down to (a) pick topic (b) write everything you know (c) research to understand gaps (d) simplify.  While I’m not big on biographies, I found this graphic novel version extremely compelling.

I suspect most makers do something very similar to this, whether they realize it or not.  My own variation on this method is to create an outline of what I want to learn with each feature I want to include, do some preliminary internet research, add links to resources to the outline, read, drill down on topics, ask questions, LRR.1

Sometimes I’ll document stuff in a notebook, but when it’s something I know will take some time to learn and probably require code and other digital resources, I like to type them up in blog posts.  It feels therapeutic, getting all this stuff written down.  I think of it as closing mental browser tabs.  Also, by adding links into a post, I can actually close real browser tabs, which is a distinct side benefit.

Default Series Title
  1. Lather, rinse, repeat []

A Cornucopia Keyboard Options

Once I started looking, I found a lot of options for a custom keyboard.  In fact, I started seeing them everywhere.1 I found these offered as some combination of “media,” “macro,” “button,” “board,” “keypad,” and “keyboard.”  I’m offering this list in no particular order – other than how I noticed each one.

 "6 Key Macro Keypad" by @iHayri1

“6 Key Macro Keypad” by
@iHayri1

1. 6 Key Macro Keypad” by @iHayri1, ~$87

I found @iHayri1‘s keyboard in HackSpace magazine, issue #37, page 101.  If you don’t happen to have it lying around – no problem!  This magazine published by the Raspberry Pi Foundation gives away their digital version!  While on the pricier end of the keyboards, it’s got a lot of interesting features.  Six buttons, a media dial, an RGB LED under each key, a series of LED’s at the base of the keypad, and an LCD screen displaying each key’s current function.  I would have ordered this one, except it’s been out of stock for a little while.  :)

"NoodlePad" by @TheMadNoodle

“NoodlePad” by @TheMadNoodle

2. “NoodlePad” by @TheMadNoodle, ~$86

I found the NoodlePad by @TheMadNoodle on Etsy after searching for media keypads.  This is another beautifully designed board – eight buttons, knurled metal knob, mounted onto a shaped board and thick lasercut acrylic plate.  This was the first board I saw referencing “QMK” firmware.  This board is also offered in a “semi-assembled” state where the buyer supplies their own switches and keycaps.  If you’re going to fall down a rabbit hole on mechanical keyboards, the switches may be what get you.  The ordering options also offer “Cherry Red,” “Cherry Blue,” “Cherry Brown,” and “Cherry Black” switches.  At first I thought this referred only to the color of the switch underneath the keycap.  As it turns out, each color matches the little bit of plastic connecting into the keycap which in turn is associated with a different set of mechanical features for that particular kind of switch.  Maybe you want a key with more bounce, requires more force, or a more gentle touch.  That you can order your keypad with the exact keys you need says a lot about this maker and their product.

This slideshow requires JavaScript.

3. “BYO Keyboard” by @travis_the_makr, starting at $36

I happened to catch @travis_the_makr showing off a prototype “BYO Keyboard” on Adafruit’s Show and Tell.  I should probably feel a little bad for hassling Travis to sell me one of these board immediately after his appearance on the show.  Intended as both a way to get started with soldering and programming as well as an actually useful final project. I kinda love the project is powered by an Adafruit Itsy Bitsy M0 so you can use either Arduino or CircuitPython.  I note QMK firmware support is a stretch goal.  :)  Don’t let this bare bones DIY kit without LED’s, knobs, and displays fool you.  If, like me, you’re only now embarking on your mechanical keypad journey and don’t have a drawer full of Cherry MX switches and keycaps, this is an excellent and affordable starting point.  Suffice it to say, I immediately pledged the Kickstarter and am really looking forward to playing with this project.

BigKnob by Leafcutter Labs

BigKnob by Leafcutter Labs

4. “BigKnob” by Leafcutter Labs, starting at $45

Of all the various keypads I’ve looked at, this was the very first one I ordered.  I opted for the version with the black steel case, wonderfully heavy metal knob, and asked the owner for some variation in the keycaps.  Craig shipped the keypad immediately and it arrived well packed in bubble wrap, only requiring that I pop in my choice of keycaps and apply the included sticky rubber feet.2 This keypad rocks four Cherry MX switches, a big hefty knurled metal knob, six RGB LED’s which glow through the lasercut acrylic base plate.  My configuration (with the metal case) was $62, including shipping.  While this is the only keypad I’ve actually used so far, it’s going to hard to top.

5. “8K Controller” by 2XLNetworks, starting at $32

Once I started tweeting about picking out some keypads, my buddy Pete told me about the “8K Controller” by 2XLNetworks.  This keypad has no LED’s, no metal knobs, no LCD displays – but it doesn’t need any of that.  It comes with a built-in USB cable, you can order it with pre-programmed with custom button assignments at no extra cost, reprogram it if you like, and it unlike a hipster clicky-clacky Cherry MX switch, it rocks arcade buttons.  If you need a bulletproof box that can stand up to repeated abuse at the hands of the public (perhaps for a photobooth, art project, school installation?), this is be the keyboard for you.

Default Series Title
  1. I’m reminded of the Baader–Meinhof phenomenon; after the first time you notice something, you notice it more everywhere []
  2. These are a great touch! []

An Assembled CuttleBot Body

This slideshow requires JavaScript.

It’s one thing to hack away in CAD software, rendering the idea of a model.  It’s another thing entirely to pull it off the print bed and pop it all together.

This slideshow requires JavaScript.

Last night before going to sleep I started the 2+ hour print job that became the center body piece for the CuttleBot.  When I woke up in the middle of the night, I plucked it off the build platform, started the tail section printing (a 90 minute print job), and passed out again.  This morning I printed 15 connector pins while getting ready for work.

Just before leaving for work, I yanked out the support structures using some needle nose pliers and popped it all together with the connector pins, and took some pictures to share with you, dear reader.

This was an incredibly satisfying result.  Sometimes the work spent on something like the little pins and sockets feels so removed from the design of the main object – so very far from the goals.  It feels similar to the work that goes into painting a house – you spend all this time NOT painting before you actually paint.  Moving and covering furniture and decorations, taping and masking areas off, removing cabinets and doors.  But, as long as I was able to keep my eye on the vision of the final model, laying that ground work on these components meant that I really could assemble a foot long plastic CuttleBot body in a few seconds.

Sigh.  At this point, it kinda resembles a CyberMat more than a robotic cuttle fish.

I enjoy sketching out my ideas, so here’s one in case you like looking at them.

It’s NOT a CyberMat! It’s a robotic cuttlefish!

So, what’s left to do?  A whole lot.  I need to:

  1. Design newer, thinner tentacles, so I can fit more into the CuttleBot’s head.
  2. Hollow out the robot’s head or at least create channels for wiring for LED’s inside the eyes.
  3. There needs to be some mounting areas inside the robot to secure one or two micro servo motors, a small circuit board, a battery, and possibly a few additional components.
  4. Possibly create a door allow easy access to the interior of the robot.  Once I start adding electronics, it might be great to have an on/off switch and nice to be able to connect a USB cable to it to recharge an internal battery or reprogram the behavior.
  5. Add the electronics and program them.
    1. This is probably two servos, several chained NeoPixel LED’s, a LiPo battery, an Adafruit Trinket, and possibly a LiPo charger (if I have one lying around).
    2. If I’m already working towards building a new version anyhow, I might want to drop a few dollars on an OSHPark Board to help make the power from the LiPo easier to route to the servos, LED’s, and board.

However, I don’t think I’m going to be able to finish the robot before Friday.

I think I could probably manage blinking LED eyes by Friday.

Maybe.

Companion Robots: Building Robot Friends
  1. Cephalopod Robot Friend, the story so far
  2. Cephalopod Robot Friend Progress
  3. CuttleBot Body and OpenSCAD Design Tips
  4. An Assembled CuttleBot Body
  5. Building the Monocle Top Hat Cat for #MicrobitVirtualConcert
  6. Companion Robots and Maker Faire Season!

CuttleBot Body and OpenSCAD Design Tips

This slideshow requires JavaScript.

I really like 3D printing – but really dislike post-processing.  This means I’ll make extra efforts to design things that can just be plucked off the build platform and hand assembled without tools.  With my limited build volume, this also means larger objects need to be printed in sections.

I’m very proud of a particular design method in the CuttleBot.  I designed the organic and non-angular design of the CuttleBot body by using the “hull” function and several carefully deformed and positioned spheres.  However, it would be very difficult to hollow out the interior – since it would mean designing another entire structure to be subtracted out.  Instead of creating the outside shape I wanted and using difference to hollow the interior, I designed the interior shape and used that to create the exterior with the “minkowski” function.

Here’s an OpenSCAD code example:

difference()
    {
    //  Traces sphere around exterior of cube
    minkowski()
        {
        //  Main object
        cube(50, center=true);
        //  Object to trace around main object
        sphere(r=5);
        }
    //  Removing center of object
    cube(50, center=true);
    // Arbitrarily large cutout
    cube(10000, center=false);
    }
Minkowski sample

Minkowski sample

Although, now that I think about it, there’s probably an even cooler way to do this!  Since the above code needs to refer to the “target” object twice, that code can be simplified by using the “children” function.  The below code creates an identical shape.

hollowObject(5) cube(50, center=true);

module hollowObject(thickness)
    {
    difference()
        {
        minkowski()
            {
            children();
            sphere(r=thickness);
            }
        children();
        //  Arbitrarily large cutout
        cube(10000, center=false);
        }
    }

The great thing about a modeling process like this is it allows  you to maintain an even thickness all the way around the model.  This would be increasingly difficult as the complexity of the underlying model increases.

Lastly, to return to the model, after hollowing out the interior of the CuttleBot, I added areas for the pins to connect the sections together.  The body of the robot is in three sections – the head, the mid-body, and the tail sections.

There’s still more to do on the model.  Ideally, I’d create a way to open the robot without having to completely take it apart each time.  A hinged door would work fine.  Also, I should probably add an area where one or more micro servos could be zip-tied or otherwise secured in place.  Also, I’ll need to modify the robot’s head later on to allow for multiple (smaller) tentacles and channels for adding wiring for LED’s to the eyes.

There’s also the whole “adding electronics” thing.  You know, to make this less a puppet and more a robot.

Companion Robots: Building Robot Friends
  1. Cephalopod Robot Friend, the story so far
  2. Cephalopod Robot Friend Progress
  3. CuttleBot Body and OpenSCAD Design Tips
  4. An Assembled CuttleBot Body
  5. Building the Monocle Top Hat Cat for #MicrobitVirtualConcert
  6. Companion Robots and Maker Faire Season!

Cephalopod Robot Friend Progress

Well, it’s here!  Today is the start of #CephalopodWeek on ScienceFriday!  There’s a little progress to report on my, tentatively named, CuttleBot.  I’ll post a picture first, then get to describing the progress so far.

Assembled CuttleBot head, side view

In the prior post I listed some of my sources of inspiration.  Another such source is the work of Sean Charlesworth and his awesome Octopod, Gowanus Monster, and newly published Scuttleship.   ((If you like his work, be sure and check out his Etsy shop!))

This slideshow requires JavaScript.

Since I need special connectors for the articulated/articulating tentacles and I wasn’t able to edit the files in OpenSCAD, I wasn’t able to use Sean’s STL files.  However, I really like the aesthetic of his designs1 and how they really evoke the form of an octopus or cuttlefish.  Here’s a mock up I used to help me visualize what a full-scale Scuttlefish head might look like with the tentacles I designed.

Scuttlefish with placeholders for tentacles

Scuttlefish with placeholders for tentacles

Unfortunately, the Scuttlefish head and body parts are just a tad too large for my small printer’s build volume.  However, even if I were using a larger printer, I would still not want such a large robot as I’m hoping for this to be a shoulder-mounted companion.

Thus, I began work creating an OpenSCAD cephalopod cuttlefish head inspired by Sean’s work.

This slideshow requires JavaScript.

Now that I had a design, I set the printer to work over night.  This design is mostly to see if the various parts for the tentacles would work with this head.  Since I want to put some LED’s in the eyes and possibly the mouth, I’ll need to hollow it out later.

The print took a little over an hour for the head.

This slideshow requires JavaScript.

How about a video of it working?

I’m very happy with the progress so far.  If I can shrink down the tentacle mechanisms, I can add more tentacles for more interesting emoting and animations.  The video just shows the results of me yanking the fishing line running through the CuttleBot’s head.

Here’s a few more sketches of how I am planning on putting it all together.

This slideshow requires JavaScript.

I might add some fabric frills / fins, instead of printed ones.  I was also contemplating letting the top “shell” of the CuttleBot be formed from 3D printed spines with a fabric or thin plastic sheeting covering.  This might help reduce weight or allow for internal lights to shine through the body.

Companion Robots: Building Robot Friends
  1. Cephalopod Robot Friend, the story so far
  2. Cephalopod Robot Friend Progress
  3. CuttleBot Body and OpenSCAD Design Tips
  4. An Assembled CuttleBot Body
  5. Building the Monocle Top Hat Cat for #MicrobitVirtualConcert
  6. Companion Robots and Maker Faire Season!
  1. Cephalopod Steampunk?! []