Giving the Gift of Receiving

When you’re a little kid, the proverb “It is better to give than to receive” sounds like nonsense grown-up talk; most little kids would rather get a toy than give one away.  But here’s a story about giving and receiving that shows what the proverb is really trying to express.

In 2010, I went to Burning Man with a bunch of friends.  My friend Debby and I were walking around the city there, checking out all the art projects, and Saturday afternoon, after we’d all been living in the desert for a week, we came across a Wishing Well.

Here’s how the Wishing Well worked: you could make a wish, or you could grant a wish.  To make a wish, write your wish on a rock (provided), along with your name and where you were camping.  To grant a wish, rummage around through the stones that other people had written their wishes on, and see if there are any wishes you can grant.  If so, take the stone with you, go find the person who wished on it, and make their wish come true.

I decided to make a wish.  I wrote on a stone that I wished for a trinket to bring home to my daughter.  I added my name, camp location, and tossed it in the Wishing Well.

 

While I was doing this, my friend Debby was rummaging around in the wishes that other people had tossed in the well.  She held up a few stones that said all sorts of predictable things, and then held up a stone that said that “Dave” at such-and-such a camp was wishing for “fresh pineapple”.  The entire population of the city had been camping in the desert for a week, and fresh fruit was an exotic wish indeed.  But then Debby said, “I’ve got one.”

“You’ve got one what?  A pineapple?”, I asked laughingly.

“Yes.  A whole fresh pineapple.  I have one.  It’s been packed in ice all week, in a cooler, back at our camp.”

I was incredulous.  “What were you going to do with your pineapple? Do you have a plan for it??”

“No”, she said, “I didn’t have a plan.  It just seemed like a good thing to have.”

“Well, do you think we should bring it to ‘Dave’, and grant his wish?!?”

“Definitely,” Debby said.

So we took Dave’s wishing stone, went back to our camp, dug the whole, entire fresh pineapple out from the cooler, and set off to find Dave.  Black Rock City (Burning Man) is never really entirely organized. In 2010, the population was over 50,000 people, and even though we had an approximate address of where to find ‘Dave’, Debby and I had to wander around quite a bit, and ask a lot of people for directions and clues before we triangulated on Dave’s camp.

When we found the right camp, we started asking “Does anyone here know Dave?  Is Dave here?”  After a few minutes, Dave poked his head out of a tent and said “Who are you?  Why are you looking for me?”

We said, “We’re here from the Wishing Well.  Are you the person who wished for fresh pineapple?”

“Yes?  Yes…” he said starting to choke up, disbelieving, and getting emotional.  “Yes, I did wish for that, but I thought it was impossible… oh my god…”

We handed the fresh pineapple, still cool from the ice, to Dave, who took it.  He stared at it as if it weren’t real, as if none of this was really even happening.  He broke out in tears of joy, hugging first the pineapple, then us, then the pineapple again.  Debby and I told him to enjoy it, and we went on our way, grinning and laughing.

 

The next day, someone I didn’t know stopped by our camp, asking “Is Mark here? Does anyone know Mark?”  I said “I’m Mark”, and they handed me a little hand-made necklace with the Burning Man logo on it, and said “This is for you to bring home to your daughter; I found your wish in the wishing well.  I made this necklace, and I want you to bring it to her!”  I gave a big smile and a big thank you, and a hug, and tucked the necklace away somewhere safe for my trip home.

 

Later, I was reflecting on these two experiences: receiving the thing that I had wished for, and giving someone else what they had wished for.   It was exceedingly clear to me which had been more rewarding to me. While I did like receiving the necklace to bring home, granting Dave’s wish for pineapple had made me feel absolutely wonderful inside, and that feeling still stays with me today.  So, I thought, I guess it really is better to give than to receive.

 

The more I thought about it, the more I came to realize that the real gift had been the one that Dave gave to me and Debby: by asking for something, Dave had given us the chance to give it to him, and then to feel wonderful about it.  It’s the same gift that I gave the necklace artist by asking for a trinket to take home: a chance to do something nice for someone and feel wonderful about it.

I think about this story when people offer “Is there anything I can do to help? Is there anything I can bring you?”  My first impulse is often to say “No thank you, I’m all set”, because I don’t want to impose on them. But then I think that maybe a better answer is to say “Why yes, actually, there is one small thing that would be nice…”, because then I am giving them the gift of being able to do something nice for someone, and to feel good about it.  It’s “giving the gift of receiving”.

Sometimes, by asking for something, we can make other people happier, and that seems worth doing.  Someone’s got to toss their wishes into the well, so other people can grant them.

 

 


Harbinger of… autocomplete

According to Merriam-Webster, a harbinger is “something that foreshadows a future event, something that gives an anticipatory sign of what is to come.”

So, now what’s the first phrase that comes to mind if I say “harbinger of _____” ?

Based on a casual poll, it seems that a majority of people answer with something like “harbinger of doom!”, a dark portent to be sure.  But, on the other hand, there’s also a substantial minority of people who seem reply with “harbinger of spring!”, a far more cheerful spirit.

This got me thinking.  What other harbingers of X are there out there, and are they more positive (like spring) or negative (like doom)?  Well, Google autocomplete to the rescue!  I went to Google twenty six times, and each time typed in “harbinger of” followed by a letter of the alphabet, and I let Google autocomplete whatever it wanted to, like this:

harbingerofp.png

Here’s the table.  In some cases, Google autocomplete didn’t give one clear answer, and so I left that line blank with a [?] note.

Harbinger of… Bad ? Good
 A Apocalypse 1
 B Blood soaked rainbows 1
 C Change 1
 D Doom 1
 E Evil 1
 F Flame  1
 G Good things to come 1
 H Hope (#2: haggis) 1
 I Impending doom 1
 J Justice (#2: joy) 1
 K Knowledge 1
 L Light 1
 M Madness 1
 N Night 1
 O O [?]
 P Peace (#2: pestilence) 1
 Q Q [?]
 R Ragnarok 1
 S Spring 1
 T Things to come 1
 U U [?]
 V Vengeance 1
 W Winter 1
 X X [?]
 Y Your perfection 1
 Z Z [?]
 TOTAL 8 5 8
Bad ? Good

A side note: that whole “harbinger of blood-soaked rainbows” business?  That comes from this bit of awesomeness: https://shop.theoatmeal.com/products/the-mantis-shrimp-is-the-harbinger-of-blood-soaked-rainbows-signed-print

So there you have it. If you take Google autocomplete as an accurate representation of totality of human spirit, intention, and our vision for the future, then there is currently  an epic, but balanced, struggle between good and evil in our vision of what is yet to come.

That may be true right now, but that doesn’t mean we’re powerless to change it.  If you personally choose to use “harbinger of spring” more often than “harbinger of doom”, you’re tipping the scales of the future toward the light, and that seems like a harbinger of peace.

 


82°

This is a 100% recycled yak fur story.

Molly asked me a thoughtful question while I was in the middle of something else and I said “Just a second, I need to rotate my brain.”   A moment later, I said OK and she asked me if my brain was all rotated now.  I replied, “Well, 82° out of 90°, close enough.”  Molly quipped “And since when did you ever do things square?”

But then I nerdsniped myself.  I started to wonder about 82° angles.  If a polygon with 90° angles is a square, what sort of polygon do you get if you turn 82° at each corner?  It’s not one of your basic shapes, because:

  • 120° angles make a triangle (3 sides, since 360° ÷ 120° = exactly 3)
  • 90º angles make a square (4 sides; 360° ÷ 90° = exactly 4)
  • 82° angles make a ??? (?? sides; 360° ÷ 82° = 4.3902439024???)
  • 72° angles make a pentagon (5 sides; 360° ÷ 72° = exactly 5)

It must be some kind of … star shape, 82 doesn’t go evenly into 360, which means that you’d have to spirograph-around the circle more than once to come back to where you started.

But what kind of star?  How many points would there be on a star with 82° angles at each point?  I decided that I had to know, and that I wanted to see what the star looked like, not just find out the numeric answer.  The numeric answer is the GCD of 82 and 360, and I could figure that out, but then where’s my picture of the star?  I decided to write a quick program to draw stars with angles of  ‘N’ degrees at each corner, and to print out how many points there were on the star.

And what’s a quick way to write a program to draw connected lines at various angles?  With Logo and turtle graphics, naturally.  Luckily, I’ve already done some programming in Logo.  Unluckily, it was back in the 1980s.  But it’s like riding an (imaginary) bicycle, right?  I was sure I could remember and pick it up again quickly.  I also (correctly) guessed that there were probably Logo interpreters that ran in a web browser using Javascript.  I chose this one, because it had handy examples and Logo language reference documentation built in: http://www.calormen.com/jslogo/

jslogo.png

So ten minutes later, I had refreshed my Logo skills.  Luckily, Logo is secretly sort of a dialect of LISP, and I’m very comfortable with LISP-like languages.  Here’s the code I finally came up with:

to anglestar :angle
  clearscreen 
  penup 
  forward 150 
  pendown

  make "count 1 
  setheading :angle

  while (heading > 0) [ 
    forward 200 
    right :angle 
    setheading round modulo heading 360 
    make "count sum :count 1
  ]
  forward 200 
  show :count
end

anglestar 82

Now experienced, professional Logo authors will notice that there’s a ’round’ in there.  Why is that?  If all these numbers are integers, why do I need to ’round’ the numbers at all?  Well, I didn’t have it in there at first, and the program wasn’t stopping.  At all.  It’s because this particular implementation of Logo, in Javascript, uses Javascript floating point numbers for Logo numbers, and since “modulo” is a floating point division-remainder operation in Javascript, sometimes instead of coming back with an answer like 377 modulo 360 = 17, it was really doing something like 377.0 modulo 360.0, and coming back with an answer like 17.000001, because floating point math is way more complicated and hard that you might think.  So after having this problem, and fixing it by inserting a ’round’ into the heading math, everything worked better.  Here’s the output from N=82°

82crop.png

And it printed “180”, meaning that this is a 180-point star.  Or, as Molly pointed out, more of a bike wheel than a star really.  An imaginary bike wheel.

I decided to try other angles since I now had this great program.  With N=80°, you get a nine-pointed star, because 80° x 9 = 720°, which is twice around the 360° circle:

80crop.png

And with N=81° you get a 40-pointed star:

81crop.png

Although as Molly pointed out, this one isn’t really a ‘star’, either.  This one is more of an imaginary bicycle gear, a lot like this real 40-toothed bicycle gear:

So anyway, the answer to the original question, “How many points are there on a ‘star’ whose lines meet at 82° angles?” is …. 180.  (And yes, the GCD of 82 and 360 is, in fact, 180!)  But to figure it out my way, I had to refresh my 35-year-stale Logo skills, debug and code around a Javascript floating point math issue, and now the floor is totally, completely covered in yak fur.

Oh, and after all this, Molly very patiently re-asked me her original question again, and I answered her without yak-further delay.

 


Easter Egg Hunt 2017

Oh, we love our Easter Egg hunts.

Oh, we love our Easter Egg hunts.  As the girls (now age 14) have grown from little kids, to tweens, to actual teenagers, what started as a simple find-the-hidden-eggs game has grown right along side them; it’s now a full-on multi-stage puzzle hunt.   2014’s hunt involved complex interlocking rules.  2016’s hunt involved cryptography and QR codes.  Now, here’s how 2017’s puzzle unfolded…

Simple

The rules were simple: each girl would be assigned a couple of colors, and each girl could pick up any egg she found once she was certain that the egg matched one of her colors.  Easy, right?  Further ‘simplifying’ things, I announced that I had placed one giant colored egg on a pedestal with each girl’s name (and one for the parents), so all they had to do was look at the pedestal with their name, and they’d see their first egg color.  I showed them all a picture (below) of how nicely I had set it up, and how easy it was going to be.

IMG_4250

But when we got outside to start collecting eggs… quelle surprise! The wind seemed to have blown the eggs off their pedestals!  How ever would the girls know which color was theirs??

FullSizeRender

Luckily, each pedestal contained a set of instructions for figuring things out in case of just such an emergency:

IMG_4278

The girls retreated to the kitchen to pencil-and-paper this problem.  After a few minutes, they’d worked it out with Rebecca offering supportive coaching (but not giving away the answers even though she’s great at these puzzles).  The girls hastened outside to each crack open their correct-color giant eggs.

IMG_4251

Inside each giant egg was a message… and another, smaller egg.

IMG_4288

Inside the smaller eggs was some chocolate, which was immediate consumed as much-needed brain fuel.  And there were also some scraps of cut up paper with writing across them — clearly they needed to be reassembled.  The girls hurried back inside, and taped the paper back together, revealing four trivia questions about opening magical doors.  (Full credit here: Three of these riddles were written by Ryan O’Boyle for Veracode Hackathon 10 & 5/7ths.  His riddles were great, and inspired me to add one additional one of my own.)

IMG_4272

It just so happened that the team included a Tolkien expert (Norm), and several Harry Potter fans (everyone but me) so the answers were quickly found.  Bonus points to Abby for remember the spell “Alohomora”, and to Eleanor for remembering that the Ministry of Magic’s phone booth code was “M A G I C” on the telephone dial — and then using the Phone app on her iPhone to look up what numbers that was.

But now what?  The girls still needed to know what colors of eggs they each were looking for, and all they had were these trivia answers — definitely not colors.  Well luckily the third giant egg, the one for the parents, contained a “Helpful, Quick, and Easy Egg Color Key!” with some hand-wavey formula clues on it about how to transform the trivia question answers into numbers.

IMG_4283

By considering a=1, b=2, etc., and adding up the letters in each trivial answer (and after I fixed a typo..oops), the girls arrived at numeric values… but still no colors.  It was more or less at this point that Eleanor started invoking the word “patricide” in her running commentary.

IMG_4253

Working through the formulas provided on the key, the girls had figured out that the variables k=112, j=250, x=147, and y=248, so, again, they had some numbers, but no colors. The key said that one color was y,y,x and the other color was k,j,k.

“But how are those colors?”, Rebecca asked, and there was a moment of silence.

“HEX CODES!” Eleanor exclaimed, and the chase was back on!  Using an Internet color code converter, the girls converted 248,248,147 into yellow, and 112,250,112 into green.  Colors at last!

IMG_4286

Now with each of the girls knowing exactly which egg colors were theirs, they scooted out to the yard.  Within just a few minutes, they’d found all of the (poorly) hidden eggs, collected them, and returned to the kitchen inside to savor the chocolate goodies within.

Then came the screams.

Then came the screams.  For inside each egg not only was there a tasty bit of chocolate, but also… more sliced up message fragments.  There was clearly another part of the puzzle. Madly, the girls sorted out all the pieces and assembled them:

IMG_4277

The team stared at this for a while, and then started discussing the fonts: Papyrus, then a font that no one knew the name of, then Times, Comic Sans, and Helvetica (with a quick argument about Arial… ending with “Well, young lady, in this house, we use Helvetica!”).  Could the five-letter word that the clue was asking for be made from the initials of the fonts?  P_TCH? PATCH was considered for a minute, but when the girls hit on PITCH, the hints about “pining”, “note”, and “curveball” all clicked!

Using PITCH, they completed the partial URL and typed in http://tinyurl.com/2017EGGPITCH  What came up at that URL was a photograph of the front of the house, with a big green arrow.

EasterVictory

The girls practically flew out the front door, flipped over the flowerpot in the picture, and were rewarded with a glass jar filled with glittery treasure eggs, yet more chocolate, and a note saying VICTORY!  CONGRATULATIONS on SOLVING the 2017 Easter Egg Hunt!

IMG_4262

Happy congratulations were shared all around, and everyone enjoyed some of their hard-won chocolate.

With the puzzles finally solved, and chocolate fully secured, Eleanor finally stopped repeating the word “patricide” over and over, which she’d started saying nearly an hour before.

IMG_4260

For the record, the total elapsed time was 56 minutes, 42 seconds — including the time it took for me to fix the typo in the math key (oops), and the time that Eleanor spent repeating the word “patricide”.

Maybe next year I’ll start making the puzzles hard.


#68: Clearway, For Inventing CDN

Bear with me here, because about 200 words from now I’m going to make a huge brag that I hardly ever talk about these days. OK, thanks. Let’s go:IMG_0172.jpg

In January 2001, “Web Hosting Magazine” published their “Top 100 Awards” issue.

Clearway Technologies, a company that I founded, shared an award for “Fastest Growing New Market: CDNs”.  C.D.N. stands for “Content Delivery Network”, a system of helping deliver web pages, images, and videos faster over the Internet; the CDN that some people may be familiar with today in 2016 is Akamai, but back in the 2000’s, there were half a dozen CDN companies, all trying to get a slice of the CDN revenue pie.

On pages 42-43, Clearway, SolidSpeed, Speedera, EpicRealm, and Akamai were all called out for awards #5, 6, 7, 8, and 9, in the overall CDN area, and for developing this hot new marketplace.

And then, later on in the list of awards, we come to #68, given exclusively to Clearway, and to me, “For Inventing CDN”.

IMG_0174.jpg

And you know what?  They’ve got the facts right here.  By the time Akamai was just barely getting started, I already had Clearway Technologies up and running, and we were already shipping our first CDN offering, and I’d already filed for the patent on our core technologies.

So while I’m a little too modest to be comfortable saying it, as far as I can tell, it’s true:
I invented the first CDN.

Now, while I do get to say that I invented the first CDN, “FireSite” and “FireSite.net”, I also have to say that I didn’t get rich from it.  Clearway was initially a ‘bootstrap’ startup, and so grew very slowly at first. Here’s the entire company, in August 1996 doing our initial product launch at Macworld in Boston.

1996-08-MacworldBOSa.jpg

Later, we took in venture capital, and we grew Clearway to over 200 people.  Here’s the team that helped do our ‘big’ launch at Networld/Interop 2000 in Atlanta.

DSCF0109a.jpg

So we grew the company and ultimately we sold it to Mirror Image Internet, another CDN company with complementary technologies and assets. And while Mirror Image is still around today, it, also, is not a success story.  Mirror Image was never able to successfully monetize the union of their existing network infrastructure and Clearway’s advanced CDN technology, and so the company has never seen the growth that we hoped.  (And thus I learned the meaning of the term “reverse stock split.”)

Other people have gone on to build bigger CDNs — most notably Akamai, who has become the dominant player in the CDN market, and they’re doing fine financially.

My original CDN patent (U.S. #5,991,809) was filed on July 25, 1996.  In the U.S. the term of a patent is twenty years from the first priority date. That means my first CDN patent will expire in two weeks, on July 26, 2016.  These twenty years have been a heck of a ride, and looking back, I’m proud of what I invented, and happy to see what it’s become.

-Mark Kriegsman, July 12, 2016.


 

Here’s the full text of what Web Hosting Magazine had to say about the invention of the CDN:

from Web Hosting Magazine, January 2001, page 77.

#68
Clearway
For Inventing CDN

Akamai may think of itself as the grandfather of content-delivery network services, but let’s not forget the man who invented the idea: Clearway Technologies founder Mark Kriegsman.

Akamai’s business plan was entered into MIT’s annual $50,000 Entrepreneurship Competition in 1998, by which time Kriegsman had already received Patent #5,991,809 for his “web serving system that coordinates multiple servers to optimize file transfers.” The U.S. Patent Office abstract somewhat cryptically describes Kriegsman’s intervention as a “networked system consisting of one primary and at least one secondary server, both capable of storing static and dynamic content. In addition the primary server houses at least one look-up table, with which the system can use various criteria to search for specific data files and allocate transmission of each file between the primary and secondary servers based on these criteria.” (What can we say? It was 1997.)

Put in more modern terms, the patent covers intelligent redirection and intelligent optimization of compound web objects, such as HTML pages, JavaScript or streaming media metafiles.

So Akamai and Digital Island can sue each other all they want about patent infringements, but Mark– we know who really came first. Wink, wink  ; )

 


Easter Egg Hunt 2016.

We’ve always loved Easter egg hunts, but with the girls getting smarter, faster, and more wily every year, we’ve had to make the hunt more… challenging.  Our previous Easter egg hunt had infuriatingly complex rules as to which girl got which color of egg.  But with the girls in middle school now — actual teenagers — I knew that I was going to have to step up my game if I wanted the hunt to last more than just a few minutes.  Inspired by some of my puzzle-crafting Veracode coworkers, I put together our 2016 Easter Egg Hunt.  Here’s how it went.

Step 1. Read the rules.

Once again, Eleanor and Abby were each given a sheet of paper indicating which colors of eggs they should each pick up.   Here are the ‘rules’ they were given for this year’s egg hunt:

2016-Easter-Egg-Rules copy

After a few false starts, the girls cracked the emoji substitution cypher. Since some symbols like🌀 and 👻  appeared only once on the page, it took some thinking to decode the whole set of color rules, but working together they did it.

IMG_8720.JPG

Step 2. Find the eggs.

List of colors in hand, they ran outside to start finding the eggs hidden around the back yard.  Each girl found all of their eggs within about ten minutes; finding the eggs themselves isn’t too terribly difficult — which is why we got into all these rules and colors and puzzles in the first place.

Step 3. Open the eggs… and wait, what’s this?

Once back inside, the girls opened the plastic Easter eggs… but wait!  Where’s the loot?!?  Instead of treats or trinkets, each egg held one small, oddly-shaped piece of paper with black and white squares on it: a QR code, cut into puzzle pieces.

FullSizeRender.jpg

Working quickly, the girls each assembled the pieces of their respective QR code puzzles.  One went together easily, the other took some collaboration and a couple of different attempts before it all came together.

IMG_8721.JPG

Step 4. Follow the clues.

Each girl’s QR code was different, and scanning the re-assembled QR codes led to two different URLs: two different tweets, by two different people (neither was me).  Each tweet had a picture and a big clue about a different location around our house.

BothTweets.png

Step 5. Victory!

Eleanor dug down into our pile of birdhouses (why we have a pile of birdhouses is a long story for another day), and Abby popped open the lid of the grill.  Each girl found a set of colored ‘crystal’ eggs — filled with sweet, sweet victory loot!

In just under 45 minutes, the girls had cracked a cypher, found the hidden Easter eggs, reassembled the QR code puzzles, and followed the twitter URL picture clues to find their well-deserved treasure.  The chocolate was sweet, but from the looks on their faces, I think the taste of victory was even sweeter.

FullSizeRender_1.jpg

Now about next year…


First light – five years later

Five years ago today I got my very first piece of LED art gear to light up for the very first time.

It was a Color Kinetics panel that you sent data to over ethernet, not an addressable LED strip & embedded microcontroller coding situation at all. The panel itself previously belonged to an LED art pioneer, “Frostbyte”, who had taken it with him on his desert adventures before his untimely and accidental demise. His old electronic gear was auctioned for charity, and without really knowing what I was getting in to, I bought this massive (28 pound!) metal box with 144 RGB LEDs in it, and the network controller to match.

Frostbyte lives

I could find no open source software to drive it, and owning the commercial sequencing/design package was out of my reach. For three years, the panel sat in my workroom idle and dark. But at some point, I found that the vendor had a simple free “test program” available, and I decided to see what I could do. Since the color data was sent from the test program to the panel over ethernet, I was able to capture the network packets, reverse engineer them, write my own code to talk directly to the LED panel, and TA-DA! First light!

But even with that one LED panel up and running, more than a year passed before I started learning how to use addressible LED strips and Arduino microcontrollers.  Another year after that, I had officially become ‘part of’ FastLED with Daniel Garcia.

And now?  Now I’ve created LED art myself, taken it on my adventures– desert and elsewhere, sold it and gifted it.  I’ve taught LED classes, and I’ve helped build an online community for thousands of FastLED users.  I’m not sure what I expected when I first bought that LED panel, but I don’t think it was all this great stuff.

So if there’s a lesson here, it might be this: If something intrigues you, step toward it.  You never know exactly where you’ll wind up, but the journey will be an adventure in the right direction.


Cautionary Tales of Power

When doing an LED electronics project, there seem to be three big “P”s that have to be tackled:
1. Pixels (which ones, how many, what configuration?),
2. Programming (what do I want, and how can I do that?), and
3. Power (how much, from where, and how do I distribute it?)

And people (by which I mean: perpetual newbies like me) tend to do them in that order: first wire up some pixels, then program them, then figure out how to power it all for real.

And of course, this often leads to a problem where you get stuck between steps 2 and 3, where you have your creation sort of up and running on the lab bench — but now there’s this little problem of how to power it, and you have to go back and rethink and rework other parts of the project to accommodate the power situation.  So it’s worth planning for power from the start — which is easy to say, but hard to do!

What could possibly go wrong? (A list)

So what happens if you don’t plan for power? Well, here are some power problems that I have personally had. How many of these can you diagnose just from the description?  (“Failure to plan” is a nice catch-all phrase here if you get stuck.)

  • Hrm, now how do I get power all the way up there?
  • Gee, that’s a long run of wire… but if I use fat wire, it’ll be expensive and heavy and cumbersome. Nah…
  • I’ll use skinny wire, it’s much cheaper… Hey, why is it only reading 4v at the far end? And does anyone smell something burning?
  • OK, I switched to thicker wire, and I’ll just re-use the power connectors from before. Holy cow now the connectors are getting hot!
  • Fine, I’ll switch to these big thick nonpolarized connectors. Huh, that’s odd, it’s not working now. Does anyone smell something burning?
  • For this other wearable project, I’ll use a simple battery holder and regular alkaline batteries… hey… why are the colors so ‘warm’.. no blue? And now no green, too…
  • OK, switching power to one of those ’emergency phone chargers’ that takes AAs and puts out 5v from a USB socket. Hey! Why are the batteries dying so fast?
  • OK, fine, I’ll switch to this lithium battery pack… hey, it said 5000mAh… so why did it stop powering my 5000ma project after only half an hour?
  • How come my WS2811 project works fine from my computer, but then flickers like crazy when I power it from this cheap USB wall power adapter?
  • For this big outdoor project, I’ll use this big, burly 12V lead-acid marine battery. Hey… how come it won’t hold a full charge after the first time I let the lights go all night?
  • Everything was working fine yesterday, before last night’s rain!
  • Everything was working fine yesterday in the cold and snow, so it should be working fine today now that it’s warming up, right?!
  • I think I’m going to switch microcontrollers.  The old one had a power regulator that could handle 12v input.  Hey… do you smell something burning?
  • Why is this power switch getting hot now? And why is it now totally stuck in the “on” position? And … do you smell something burning… again?

So: Plan For Power.

The lesson to learn here is that for basically any real project, calculate and plan the power first.  Before you wire up any pixels. Before you write any code. Just stop for a minute and think about how much power you’re going to need, and where it has to come from, and where it has to go.

Use on-line calculators that will help you figure out how much power you’re going to need, and what gauge wire you’ll have to use given how long your cable runs are going to be.  I also really like the “LEDstimator” app for iOS to help explore some “what-if” values for things like wire gauge.  https://itunes.apple.com/us/app/ledstimator/id945794010?mt=8

And above all else… uh… wait… do you smell something burning?

 


FastLED for the Apple II: Hack to the Future!

These days, I hack LEDs.  I’m the co-author (with Daniel Garcia) of the FastLED library for driving tons of high speed LED pixels and strips using microcontrollers like Arduino and Teensy.

But back in the day, I hacked a lot of Apple II.  I published a couple of shoot-em-up games (with Geoffrey Engelstein), all written in lovingly hand-crafted 6502 assembly language.

Finally I decided it was time to link the present to the past: to connect a hundred high-speed RGB LEDs to an Apple II, somehow, and ‘port’ our FastLED library to 6502 assembly language.

Well, I did it, and it works.  My new creation, “FastLED6502”, can drive a hundred 24-bit RGB pixels at more than 30 frames per second from an Apple //e :

The Details

Here are the details of “FastLED6502”:

  • “FastLED6502” is a lightweight port of FastLED’s core functions to 6502 assembly language for the Apple ][, Apple ][+, Apple //e, and Apple //gs.
  • Supports APA102 / Adafruit DotStar LED strips, as well as LPD8806 and WS2801 (though those two are not fully tested yet).
  • The LED strip is connected to the Apple II using the 16-pin DIP game port on the computer’s motherboard.  The 9-pin DB joystick/mouse port on the back of the //c, //c+, and //gs cannot be used, as it lacks the TTL digital output signals needed to drive the LED strip.
  • 24-bit FastLED Rainbow colors are included, along with FillRainbow, Random8 and a number of other useful functions from FastLED’s main library.
  • Everything had to be re-written from scratch in 6502 assembly language.  Luckily(?), I still remember how to do that.
  • The assembly code knows the binary serial protocols for the APA102 (Adafruit DotStar), LPD8806, and WS2801 LED driver chips.  Depending on which one you select, FastLED6502 transmits the LED colors in the correct protocol over the game port TTL digital output lines.
  • Considering that the Apple II sports a 1MHz 6502 so slow that even a “NOP” takestwo cycles, overall performance is pretty good: more than 30 frames per second for a 100-pixel strip.
  • Speaking of speed, or lack thereof, “three-wire” clockless LED strips such as the WS2811 NeoPixel are not supported now, nor will they ever be.  The CPU is would need to be at least 20X faster to support them, and it isn’t.  For that you want an Arduino or Teensy, and FastLED proper: http://fastled.io/
I gave the code its public debut at Veracode Hackathon 7.  (The theme was “Cozy Cabin” — I don’t usually wear plaid.)
I don't usually wear plaid.

FastLED6502 at Veracode Hackathon 7

How’s it work?

So how does this all work? Well, you connect the CLOCK and DATA_IN pins from the LED strip to a couple of pins on your Apple II’s DIP game connector port, add power, and you’re ready to go.  The Apple II’s game connector not only has inputs for joysticks, paddles, buttons, and so on, but it also has a few digital outputs — and that’s what FastLED6502 uses to deliver signals to the LED strip.  On all the 16-pin DIP Apple II game ports (except for the //gs!), there’s even one pin that delivers a super-fast digital pulse; pin 5 is the C040STROBE line, which can pulse twice as fast as the other digital outputs.  If you choose that for your CLOCK pin, the FastLED6502 code automatically shifts into high gear, and you get faster performance.   FastLED proper does this, too, in a much fancier way; it’s amusing that ‘little’ FastLED6502 does some of this, too.

The Code

The code is in the “extras” directory here (and eventually on FastLED’s main branch, but not yet)
Here’s the FastLED6502.s65 source code itself:
https://github.com/FastLED/FastLED/blob/FastLED3.1/extras/FastLED6502.s65And here’s the RainbowDemo.s65, as shown in video:
https://github.com/FastLED/FastLED/blob/FastLED3.1/extras/RainbowDemo.s65

This is Crazy

Overall, this bit of code is completely nuts, and we don’t expect anyone to use it.  At all.  Ever.  Accordingly, we’re not going to really support it, either.  At all.  Ever.  It was a labor of love and a creation of pure modern retrocomputing insanity.  But here it is, in all it’s insane glory, “FastLED6502”.
And now, if you cut me, I’ll bleed 16,777,216 colors at thirty frames a second.

Iteration impels improvement.

This thing that I am casually holding up in one hand is an 7′ x 3′ LED tapestry, plus diffuser, plus controller box, plus all mounting hardware, plus power supply and extension cord (rolled up inside for easy transport). It’d fit in the carrying bag for a folding camp chair.

20140719-074428-27868758.jpg

Now, truth be told, I’m not crazy about the layout of LEDs on it (too gridular)…

20140719-074816-28096520.jpg

…so there will be at least one more iteration of this “small” one before I build the “big one” for playa. But. It feels good to have come this far: the previous incarnation had to be wheeled around in a suitcase, and required complicated mounting due to it’s own weight.

Next iteration will focus on making the layout more ‘organic’ (the way I like it), and continuing to rethink how the diffuser is held at the right distance from the light.