Topic: "Radiopunk" // In Which Teague Uses This Forum As A Notebook

http://www.friendsinyourhead.com/arduino/radiopunk-web-black.jpg

It's done. The completed essay can be read or listened to here.


Despite my generally internet-avoidant inclinations of late I've been asked to write an article for an electronics website about my Connect Four Arduino project, and the process of improvement from being a total idiot with absolutely no experience in any of the fields involved to becoming a sentient crystal of enlightened electronics insight, and, you know... all that shit.

I have a hard time writing when I don't know the audience, and I don't know the people I'm writing this for. I am assured they will probably care about what I have to say when they read it; I just need to get it down on paper. My fabulous solution to this problem is to write my article here, as a series of posts, and pretend it is you who is the one who is caring.

I am told they will provide editorial oversight and mitigate any over-sharing that might (will absolutely) be included in the first draft, so this is just a place where I have to finish the story 'cuz I said I would, and I'll copy-paste the result over to them, and then they'll cut it down to five tweets, and maybe later I'll read this long version as another audio narration thing for like two people to listen to when they're desperately old mutants reminiscing about the voices of humanity from before The Great Burning.

Anyway, I'm gonna start typing now.

Teague Chrystie

I have a tendency to fix your typos.

Thumbs up +4 Thumbs down

Re: "Radiopunk" // In Which Teague Uses This Forum As A Notebook

In the early months of 2015, I decided to stop doing pretty much everything I had been doing up until that point — certainly to stop thinking the way I had been thinking up until that point — and unplug everything. I had spent the previous fourteen years trying to make the internet care about everything I did, and somewhere between how that's obviously a terrible endeavor for anybody and how it's a particularly terrible endeavor for me, my spiral of increasingly-tiny validation windsprints collapsed into a disgusting pile of panting jackass and everything stopped.

This story isn't about that at all, and I will set it aside after pointing out that the mess above is where my head was at when I, out of nowhere, and for the second out-of-nowhere time in my life, did something my friend Paul told me to do and dove into something I knew nothing about.

(The significance of this is only dawning on me now — previously, Paul had been the shoulder-devil telling me not to blow off a friend's generous offer to produce a record with me, and now Paul had installed a little birdie on my shoulder to sit there and insist that I learn Arduino. I didn't even know the word Arduino prior to him saying that it seemed like the kind of thing I should get into, so, I owe that guy a dinner; I also still owe him some piano lessons from a previous obligation. The moral of this paragraph is, "if you're lucky enough to have a Paul in your life, make sure your Paul is treated better than mine.")

Arduino, for the uninitiated, is an electronics platform that brings together the concepts of basic electrical engineering — wires, resistors, microchips, circuit boards, motors, switches, LEDs — with the concepts of software coding — programming, debugging, writing scripts for various complex outcomes based on user behavior — in a friendly ecosystem of institutional tweakability and with a broad community of like-minded tinkerers. Want a machine that sends you a tweet every time your cat poops? ...why? No no, sure, okay — you can knock that out in an afternoon. How about this: want to keep the door to the litter box closed unless your cat is walking by, so the dog doesn't get into it? We'll need a couple parts for that, but pre-made versions of both of them are already being sold online for a couple of bucks each. Let's do it. What's that? You want to receive a text that confirms your cat has been drinking your beer and just failed a breathalyzer test that you've hidden in their litter box? You might be powerfully insane. Done.

As you will have no trouble imagining, when Paul explained to me what Arduino was, visions of unlimited power descended upon me. I knew nothing at all about electronics or programming, so I got a book for beginners and a spiral-bound notebook and started taking notes, like it was a class; resistors are measured in ohms, capacitors are measured in farads. At the same time as I was wading into the Radio Shack stuff, I was learning first principles as a programmer; if/else arguments, floating point numbers, looping logic. I had fine-tipped Micron pens in a handful of colors, and I'd sit down and make diagrams for myself until everything seemed to make sense.

It was boring. It was abstract. Nothing I was learning would stand a chance of being committed to memory without having some practical use to weigh that memory down; 'necessity is the mother of actually remembering Kirchoff's Law,' etc.. What I needed was a big, cool project to work on, something where I'd be learning these things because I had to — something I'd want to want to finish, something that promised to be cool enough that it'd be worth the inevitable frustration of figuring out how to do it.

I don't care about Connect Four at all, it must be said. I'm bad at Connect Four; I don't have any particularly fond memories of playing Connect Four. I think my mind drifted to Connect Four only after I had established limitations of sensibility; "maybe a video game something," "with minimalist gameplay," "and minimalist control surfaces." I settled on the faux-antique furniture styling — which, when combined with period-incorrect electronic fixtures, I would later refer to as "radiopunk," dorkiness be damned — because I happened to know that said look is, secretly, pretty easy to pull off if you know your way around a hobby store; that particular combination of aesthetics gives a high coolness-return on your difficulty-investment.

Take a dead-simple user interface of knobs and LED lights, use it to run a dead-simple game of stacking lights, build it into an almost dead-simple wooden box; I figured I had arranged a solid threefer for myself. I had no idea at all — no idea at all — how any of the stuff beyond, "first you drill holes in a box, then you finish the rest of the project," was going to actually happen, but... whatever.

My "day job" is visual effects for movies and television; every day I'm asked to create images of things that don't exist. It's fun work, and applying those skills at home for dumb little projects is just gravy on top. In a week and a half, I had gone from throwing out everything I used to do in my free time and having no idea what I would do with myself, to finding an exciting new direction to explore, and then conceiving of a place to aim for. Then, after an hour of fiddling, I found myself staring at a concept image.


http://www.friendsinyourhead.com/arduino/000.jpg


Everything up unto this point was all well and good — a big idea, a couple intentions, a handful of completely unqualified assumptions that several things I knew nothing about would be doable upon trying — plus one quick 3D graphic — but then, staring at the image I'd made, a couple of things settled on me. I really, really wanted that stupid Connect Four game, for one thing, and — without really considering it — I had somehow gotten myself into a position where the only way to silence the buzzing in my head would require tricking electrons into dancing for my amusement, and the only part of the process I understood was drilling holes.



Will Teague become a sorcerer?
Will Kirchoff's Law be remembered?
Will his actual box in any way resemble the concept art?

Stay tuned

Teague Chrystie

I have a tendency to fix your typos.

Thumbs up +5 Thumbs down

Re: "Radiopunk" // In Which Teague Uses This Forum As A Notebook

Bra fucking vo, sir.
I've been silently watching your progress on this lil' fellah in the chat.

I'm on the board of our local Makerspace(tm), (and setting up a Maker Faire in late August [/implied rejectionphobic invitation]). Once the electronics website guys are done with this, I bet we could get you into MAKE magazine.

(UTC-06:00) Central Time (US & Canada)

Thumbs up Thumbs down

Re: "Radiopunk" // In Which Teague Uses This Forum As A Notebook

I've been looking into getting some arduino's for Grayson and I to work on together.  what's a good resource?

Eddie Doty

Thumbs up Thumbs down

Re: "Radiopunk" // In Which Teague Uses This Forum As A Notebook

For about a month straight, in addition to my regularly-scheduled book perusal and educational baby steps, I was taking wild shots in the dark on Google trying to figure out various pieces of my puzzle; I put a folder of bookmarks on my toolbar and began to drag everything on the internet into it. The real complication in setting yourself upon a task that far exceeds your grasp is that, while you might have a vague sense of what your success will visibly resemble, you don't even know the insane options for how to get there — much less any of the sane ones. You feel like the Wright brothers, poring over pictures of birds in flight, going, "okay, well, they all seem to have... heads. Let's start with heads." It's not even a joke; you just literally have to start somewhere and start crossing things off the list.

For instance, early on in the "learn Arduino"-style books, operating an LED is a common task — there's only a couple principles doing the heavy-lifting, which are to make sure power is connected to the correct wire and to make sure you don't give it too much power. That's it. You don't have to invent the concept of semiconductors, you don't have to figure out how to make 'em from existing materials on Earth, and — to be completely honest — you don't even have to understand them. It matters which side gets the power, and it matters how much power they get; after that, you can turn them on and off all day and they're happy to do it. In the Wright brothers analogy, this would be equivalent to going "okay, let's start with birds," and having that be the right instinct.

Of course, the next part is that you focus on the wrong part of the bird. An LED is very easy to operate, and we're just talking about knocking out a bunch of 'em, so the trick is patience — right? Nope. Your problem is not that you need a grid of 7x7 LEDs and will therefore have to wire those up, your problem is that 49 LEDs must operate as individuals. Rigging up a switch with an LED that turns on and off is simple, even rigging up 49 LEDs to turn on and off is simple — getting them all to be separate intelligent entities inside of one circuit (note: not 49 circuits) is the hard part. While we're at it, and not to pile on, but... the idea with this game is that each player can pick their color, which means instead of communicating a message of 'this-much-brightness' to each LED, we're communicating messages of 'this-much-red,' 'this-much-green,' and 'this-much-blue' to each LED. It's not 49 signals; it's 147.

To clarify the shape of what makes that tricky, let's take a step back and establish first-principles for how an Arduino board works.

We know (without knowing the specifics, of course) that it's within the realm of human ability to take a piece of blank circuit board and throw some light bulbs and switches on it and make a little circuit that routes power through various components at various times depending on which switches you open and close. We mess with light switches every day, for instance, and we've all managed to internalize the process by which you can move from room to room and change which lights are on and which ones aren't. To happily state the obvious: once such a system has been made — a big one in a house or a little one on a piece of perforated plastic — it will just sit there, doing nothing. It waits. You have to bring your finger (and your intelligence) to the circuit and start pushing various buttons for anything to happen next.

Unrelated to that, we know (without knowing the specifics, of course) that certain folks have the ability to open a low-rent word processor like Notepad and type code using the ancient computer-math language of the mystics, and that somehow the computer will follow those instructions. Software, web pages, games, even expressions in Excel; for the past few decades, humans have been devising and implementing various shorthand rulebooks for what a machine is supposed to do when X happens and what it's supposed to do when Y happens.

With those things in mind, the premise behind Arduino is simple: a user-friendly system for making circuits that use computer code — instead of fingers — to push the buttons. You set up the circuit, you set up the behavior; Arduino will take it from there.

In terms of actual abilities, when you get right down to it, the Arduino board can only do (and only needs to do) three things: 1. it needs to understand and articulate incoming voltage, 2., it needs to understand and articulate outgoing voltage, and, 3, it needs to follow orders. Once you have a machine that you can easily program, a machine which can read an incoming voltage over here, compare it to rules that you've told it to follow, and set an outgoing voltage over there — sixteen million times a second — what you really have is a minion. The relatively expensive "entry-level" Arduino — the everything-made-easiest, capitalize-on-the-newcomer, we've-gotta-turn-a-profit-somehow "Uno" board — costs less than a steak dinner. This price includes the board and the extra time they spent making it easy to use. Once you're no longer intimidated by smaller boards and unlabelled terminals, you can buy god-like power for a fiver and nobody looks askance.


http://www.friendsinyourhead.com/arduino/001.jpg


By the time I arrived at the problem of needing to send 147 messages to 49 light bulbs, I knew all that. I knew you could read voltages from high to low (allowing for things like knobs, returning different voltages to the Arduino as you adjust them), I knew you could set voltages from high to low (allowing for things like lightbulbs turning on and off), and I knew you could make an Arduino flip a lightswitch sixteen million times a second. What hadn't occurred to me was this: the voltage input/output terminals on an Arduino Uno (we call 'em I/O pins) only number in the low dozens. You could do exactly what I had in mind — which is to say, you could run a wire from the Arduino to an LED and turn it on and off with the speed of a cosmic deity — with, perhaps, 15 LEDs. Not 49. Certainly not 147.

There's one tool of thought that makes this problem — definitely perplexing — slightly easier to approach than manned flight of a heavier-than-air machine: the situational freedom to get sullen, get mad, and declare to the uninterested world that "there's just, like, absolutely no way that this is actually impossible, right?"

Incidentally, it's the same tool the Wright Brothers used to get their shit off the ground. What makes them special is they had no reason to think it in the first place, and I had nothing standing in my way except for not knowing what to Google next.

We all have problems, is my point.



Will Teague teach an Arduino to grow an extra hundred I/O pins?
Could a man possibly use any more em-dashes?
Will we keep doing this 'stay tuned' joke for the whole series?

Stay tuned

Teague Chrystie

I have a tendency to fix your typos.

Thumbs up +1 Thumbs down

Re: "Radiopunk" // In Which Teague Uses This Forum As A Notebook

Eddie, you should look into a thing called the Makey Makey, which is along the lines of an Arduino without the coding. Great jumping-off point. Anything you can control with a keyboard, you can now control with anything.

I got Paul one of these a while back — he made a joystick out of a cup of water and we used it to operate an online flight simulator. All sorts of possibilities, very little confusion.

Teague Chrystie

I have a tendency to fix your typos.

Thumbs up +1 Thumbs down

Re: "Radiopunk" // In Which Teague Uses This Forum As A Notebook

I wouldn't have gotten into Arduino at all-but early revisions of my quad-copters' PIDs and gains were only  programmable with arduino-code. Super glad I dipped my toe into the Arduino pool--the functionality-the possibilities are endless.

The difficult second album Regan

Thumbs up Thumbs down

Re: "Radiopunk" // In Which Teague Uses This Forum As A Notebook

Makey Makey looks stupidly fun!

Thumbs up +1 Thumbs down

Re: "Radiopunk" // In Which Teague Uses This Forum As A Notebook

I thought about bastardizing the makey makey into a custom short-cut key box for the transport functions of my DAW but never been arsed.

The difficult second album Regan

Thumbs up Thumbs down

Re: "Radiopunk" // In Which Teague Uses This Forum As A Notebook

One of the forgiving aspects of diving headfirst into a pool of unknowns is that, while the pool is mostly comprised of "struggles" (cold water), there are also a few warm areas of "ease" (pee). Such was the case for me and my LED problems; for a week I floundered among various deeply confusing strategies for making a light matrix, learning about things like "Charlieplexing" and persistence-of-vision gags and all kinds of disheartening complication, before I found myself in a pleasantly warm pocket of surprise.

So, there are these things called Neopixels.


http://friendsinyourhead.com/arduino/010.jpg


For anybody looking at the end result, there's not much of a difference between normal LEDs and Neopixels; they're just little lightbulbs. In fact, the Neopixels I ended up using are pretty much a string of Christmas lights. The difference is that a string of Christmas lights would be a daisy chain of bulbs, and the Neopixels are a daisy chain of microchips. Each Neopixel is a little circuit board with a chip on it that can be given instructions — really, each pixel is like a dumb little Arduino — and the chip controls an RGB LED.

The salient feature of Neopixels is that the first pixel knows it's Pixel 1, and the next one knows it's Pixel 2. As such, instead of sending voltages to each of your lights, you send data to one. Instructions for the whole string of lights goes into Pixel 1, and Pixel 1 takes the first command and passes the rest along. Each Neopixel sorts out its own voltage.

One short week after my initial plan fell apart, with one stroke of surprise luck-pee, I'd gone from needing 147 wires to needing 4; a red one for power, a blue one for ground, a green one for timing, and a yellow one for data. (Most newer Neopixel products only use 3 wires, in fact — power, ground, data.) I bought two strings of 25 and connected them end to end. They arrived a few days later, and worked immediately. No fuss; sudden glory.

Which — huh. Right, so that's one thing down.

After psyching myself up for mountains of confusion, and then immersing myself in said confusion for a week or more, the whiplash success of the Neopixels gave me a goosin' of confidence that this whole thing might really come together as anything more than an idea. Up until this point, everything I had ever done with electronics had been included in the little starter kit my Arduino came with — minor blinky contraptions, built on plastic circuit boards meant for prototyping. My attempt to make a buzzer buzz was unsuccessful; such was my level of physical expertise. I had a bit more theoretical experience — spending a week trying to comprehend Charlieplexing will do that to you — but I still hadn't actually done anything, beyond filling a notebook with doodles and filling a folder with the bookmarked secrets of the universe.

In the same online order that bore my Neopixels, I also snagged a handful of bits and bobs I thought I would end up needing for my first foray into the physical reality of electronics: I got myself some knobs and the potentiometers they would be attached to, a giant red button for mashing, a giant chrome toggle-switch for power... and also a soldering iron, for binding the metals of Earth together at 700° Fahrenheit.

The Neopixels were unproven at purchase, so there was a bit of nervousness about that. I had never put a knob on a potentiometer before, so I wasn't certain I'd matched the sizes correctly; plus, I bought the pots after doing no math at all, so whether or not they'd adjust voltages within the right order of magnitude was a shot in the dark. It all felt quite a bit like being Harry Potter and walking through Diagon Alley for the first time, picking up magic items at random, hoping they're the right ones — and that's just the components. There's a second kind of nerves reserved for purchasing equipment that gets incredibly hot and does things with molecules — I didn't even engage with those nerves, I bought my soldering stuff at random. I trusted myself; there's a million magical items for you to choose from at Diagon Alley, but the soldering iron chooses the soldering wizard.

("Boy, that metaphor took a turn for the precious." Shut up. "Can't we go back to the pee in the pool metaphor?" Shut up.)

After testing the Neopixels — finding myself suddenly able to control the color and brightness of 50 individual lights with ease — I set my sights on the rest of the project. I needed to mount a 7x7 matrix of Neopixels, I needed to mount my knobby-pots and toggles; I needed to reach a rapprochement with my wand and figure out how to solder without cooking myself, to say nothing of the fact that I also needed to teach a computer to play Connect Four using nothing but logic. My work was cut out for me; all that was left to do was suddenly bring back the pee metaphor and stop typing.




Did the knobs fit?
Can you teach a string of lights to act like a grid?
Will Teague burn himself over and over again with the thing?

Stay tuned

Teague Chrystie

I have a tendency to fix your typos.

Thumbs up +1 Thumbs down

Re: "Radiopunk" // In Which Teague Uses This Forum As A Notebook

I'm anticipating the answers to the three questions to be: Sorta, yes, and emPHATICALLY yes.

Witness me!

Thumbs up Thumbs down

Re: "Radiopunk" // In Which Teague Uses This Forum As A Notebook

<--- Really digs Teague's writing style and sense of humor.

(UTC-06:00) Central Time (US & Canada)

Thumbs up +2 Thumbs down

Re: "Radiopunk" // In Which Teague Uses This Forum As A Notebook

Same, the pee in the pool metaphor made me actually laugh out loud.

Also, technically you're still sending voltages, but they're carrying a digital signal instead of an analog one.

"ShadowDuelist is a god."
        -Teague Chrystie

Thumbs up +1 Thumbs down

Re: "Radiopunk" // In Which Teague Uses This Forum As A Notebook

Really hoping you follow through with the audio-book thing, "The Internet Knows Where I Live" is still in regular rotation amidst my DiF Highlights playlist.

Thumbs up +3 Thumbs down

Re: "Radiopunk" // In Which Teague Uses This Forum As A Notebook

Wait, this thread is way too positive. If we don't balance it out, the world will devolve into chaos.


...This SUCKS! There's probably a typo in it and everything! Teeaaag-g-g-g-g-ooeee!

Witness me!

Thumbs up +2 Thumbs down

Re: "Radiopunk" // In Which Teague Uses This Forum As A Notebook

Thanks, peeps. Once I get the whole thing down on paper — and then go back over it with a fine-toothed comb a couple times — I'd definitely do a narration thing with it. Shit, the narration is the fun part.  big_smile

Teague Chrystie

I have a tendency to fix your typos.

Thumbs up +3 Thumbs down

Re: "Radiopunk" // In Which Teague Uses This Forum As A Notebook

Computer code is a lamentable red herring. It's the only part of the whole human project known as "programming" that most humans will ever see, and its primary role for them is to be the barrier that separates them from venturing further. Code is to programming as walls are to the view.

What's happening inside the process of programming is debate. It's using logic to assure that your point is made, and made so soundly that no opposing argument can beat it. Software bugs are holes in your argument. Malicious hackers are jackass pundits twisting your words out of context. Good programming is foolproof wording. (Code is the old-tymey judge wig you have to wear before they'll let you speak.)

I didn't know any of this until I was good and deep into the Arduino programming language, which is basically a stripping-down of an older language called "C." The language — the code — is just learning; just plain-old terminology and syntax, like anything else. The meat of the endeavor is in the logic.

It should be mentioned for the record that I could only see about six inches in front of my metaphorical nose throughout the whole programming process. Connect Four was my first coding project, and it was like getting a boulder to the top of a mountain — countless inches, constant pushing. First you start, then you don't stop, then you keep yourself convinced that it'll get there eventually. The version of events presented here is summarized and significantly streamlined to tell the story of what worked, but I'd be remiss not to mention the innumerable setbacks that I'm glossing over: sometimes I pushed the boulder miles and miles into a dead-end; sometimes I'd dead-lift the damn thing up a sheer cliff face only to find that there had been a ramp right next to it. Let this acknowledgement of my failures stand as advice for whoever pushes the boulder next; just start, and then don't stop.

And — not for nothing, but this particular entry in the CoFoiNo saga goes pretty well with music.


I had 50 Neopixels in a string, and I wanted to be working with a 7x7 grid. The plainest solution would be to cut my string into seven strings with seven lights each, and address individual pixels by saying, "okay, pixel two on the third string," or something along those lines. I didn't actually use this strategy, because I didn't feel like hacking up my new gizmos, but I did simulate it. I definitely wanted the ability to address individual pixels that way. I decided to abandon the built-in numbering system on the pixels and create a little set of instructions that would allow me to "work" in a grid system, and at the last minute convert my grid coordinates back into Neopixel-ese. After a bit of doodling, I went with a system of [rows][columns] for horizontal/vertical, starting from the bottom left corner — [1][1] would mean "bottom left," [7][7] would mean "top right," [1][7] would mean "top left," and so on. Meanwhile, with my little set of instructions, I could tell my Arduino to light up pixel "[7][1]," and it would automatically translate that to "Neopixel 0."

Once I had an addressable grid system — really, a low-resolution monitor — I could start fiddling with the actual game logic. My vision of the game was as follows: once turned on, the pixel matrix would display a big "P1" for player one, and three knobs would be adjusted RGB-style to change P1's color; once settled upon, player one would press the big red button and the screen would provide the same opportunity for P2; once the big red button was pressed again, the game would start. The gameplay would involve a single indicator light at the top of the screen, showing the color of the current player, which could be moved from left to right using a big twisty-knob; once the light was placed over the desired column, the player would mash the big red button, and the light would "fall" down into place as if it were an actual tile in an actual Connect Four frame. The top indicator light would show up again, this time in the other player's color, and the process would repeat until somebody won.

At the end of the day, the logical hurdles are fairly easy to clear: there's only two players, there's only six spots in each column below the indicator light, the columns don't need to know anything about each other (at least, not until we start talking about detecting wins), all the color-picking stuff could even be thought of as a wishlist item — the game would work fine with pre-set player colors, who said this was a democracy? — and it's really just a bunch of column-content lists in memory, with a monitor displaying the status of those lists.

A human trying to understand the logical ingredients of this game will not struggle; pure logic, on the other hand, requires some groundwork to be laid, and this is where the "programming as presenting an argument" metaphor comes in. For instance, one of the simplest mechanics of Connect Four — tile is dropped, tile stops on top of stack — is actually a fairly complex pile of givens. Tell the tile to drop, it won't know what you mean; you'll need to teach the tile that "drop" means "move down," and you'll need to help it with how fast it should fall. Tell the tile to drop, and drop it will; all the way off the matrix and into the unseen forever. Tell the tile to drop and stop after six moves, and it'll happily do so; but, when you drop another tile, it will do the same thing and over-write the first. This game of iterative clarity can seem pedantic, even strangely autistic; it also comes with a certain amount of comfort in knowing that at least something is taking you seriously.

Here's a pseudocode version of the tile dropping:

if [button is pressed]:

define variable _stackedAlready_ = [however many tiles are already in this column]
define variable _dropCount_ = 7 minus stackedAlready
define variable _currentPixel_ = 7

command = [turn on currentPixel, turn off currentPixel, redefine currentPixel = currentPixel minus 1]
repeat command [dropCount] times

command = [tell memory that this tile is here now, redefine stackedAlready = stackedAlready plus 1]

In English, that reads:

When the button is pressed,

since you know how many tiles are already in this column,
you can subtract that number from 7 to know how many "drop" movements we'll have to make.
We'll start falling from a height of 7.

To "fall," we're going to blink pixel number [current#], and then subtract 1 from [current#]...
...and repeat that process several times; blink [current#], subtract 1 from [current#], blink [current#], etc..

Once we've stopped, we'll update the memory so it knows we're here, and update the tile count for this column.

If you're confused, keep staring at those boxes until you can see the point: settling on givens, building them up in baby steps... this modern business of programming computer chips is essentially Socratic.

I steadily worked through these little clumps of logic, testing them from time to time on my unruly rat-king of Neopixels; making headway and saving often. (Also, commenting the hell out of my code; you can leave human-readable notes in your code by "hiding" them behind a pair of forward-slashes, and it's with these comments that you can clarify what your code does and what on Earth you were thinking when you wrote it.)

// a "rat-king" is a real phenomenon wherein a bunch of rats become tangled in each other and trapped




http://www.friendsinyourhead.com/arduino/011.jpg



As the programming started to come together — slowly at first, and then surprisingly quickly as my logic grew more robust — it only served to highlight the relative unsexiness of my rat-king Neopixels. I was achieving true progress, here — what good was progress if all it could do was light up a knot?

Time was that this project really, really, needed a box.



Is a box in Teague's future?
Will other posts be provided with their own score?
Must we wear this wig?

Stay tuned

Teague Chrystie

I have a tendency to fix your typos.

Thumbs up +4 Thumbs down

Re: "Radiopunk" // In Which Teague Uses This Forum As A Notebook

Nice write-up. The way this simplifies and explains a lot of important coding aspects is great. As a bit of an "editor's note:" It's not immediately clear that the "six inches in front of my nose" thing is part of the metaphor, I briefly pictured you trying to code with your face pressed against the screen. Unless you actually did go temporarily blind, then carry on.

Also, the way you format your curly braces is insane.

"ShadowDuelist is a god."
        -Teague Chrystie

Thumbs up Thumbs down

Re: "Radiopunk" // In Which Teague Uses This Forum As A Notebook

ShadowDuelist wrote:

As a bit of an "editor's note:" It's not immediately clear that the "six inches in front of my nose" thing is part of the metaphor, I briefly pictured you trying to code with your face pressed against the screen. Unless you actually did go temporarily blind, then carry on.

Good call. Edited.

ShadowDuelist wrote:

Also, the way you format your curly braces is insane.

[egon-spengler_your-mother.gif]



EDIT: Also, for the record, thanks for saying the first bit. I was anxious to see what the real coders would say about this one.

Teague Chrystie

I have a tendency to fix your typos.

Thumbs up Thumbs down

Re: "Radiopunk" // In Which Teague Uses This Forum As A Notebook

Teague, this write-up is fantastic!

Teague wrote:

This game of iterative clarity can seem pedantic, even strangely autistic; it also comes with a certain amount of comfort in knowing that at least something is taking you seriously.

I love that, never thought of it that way. Though in some instances I've found it feels like the computer couldn't care less what I think.

I don't know if you're at all interested in expanding this project, but I wrote a connect four AI in school a couple years ago. If you're interested in implementing a single-player option, I'd be happy to help with it.

Thumbs up +1 Thumbs down

Re: "Radiopunk" // In Which Teague Uses This Forum As A Notebook

That's interesting. Maybe.

I mean, my own personal "perfect" AI would just pick a random column, because that's my strategy, but.

Teague Chrystie

I have a tendency to fix your typos.

Thumbs up Thumbs down

Re: "Radiopunk" // In Which Teague Uses This Forum As A Notebook

You know the problem with customizing a box? There's no drama in it.

So, scientists thought rogue waves were a myth until 1995, when an oil rig off the coast of Norway, on an average day of thirty-foot seas, recorded an eighty-five foot wave. You can look at the recorded chart of waves that day, and it looks exactly like the chart for every other day — a steady sine pattern, a million identical peaks — with one peak that stands three times taller than the rest, starkly un-mythical, making you nervous. There was no warning. The wave before was normal, the wave after was normal, and the wave between was a tower. Fields of math were changed to reflect reality, prediction models snapped into place, and now satellites see rogue waves all the time. They're a fact of nature; behemoth vertical anomalies reminding the sky that the ocean is always coming for it.

Anyway, you can buy boxes at the craft store.


http://www.friendsinyourhead.com/arduino/025.jpg


A brief word about the process of drilling holes: I knew that my Neopixels would require a 3/8" bit, and my first attempt at drilling made use of a "normal" drill bit at that diameter. Anyone following in my footsteps should know that what happens next is a supersonic collision between the box and the drill, which is a mistake that costs however much a box costs. A spade bit is the way to go for this; nice clean holes, nice sane drilling. Throw a printed grid onto the box, Sharpie a little dot through all the intersections, and nestle the spade bit into the dots. Drill, plunge, repeat.

(Continuing in the general spirit of scientific reporting, I want to provide one other key insight that was discovered along the way. Once you have a box of holes — perhaps, say, covered in sawdust and needing to be cleaned — pressing the pipe-end of a floppy vacuum hose against those holes and sliding it around creates exactly the sound of a radio being tuned. It's crazy. You're welcome, future.)

I went through over a dozen arrangements of buttons and knobs before settling on a layout; once determined, another few spade-bit holes were popped into the box and components were finger-tightened into position. The Neopixels were also temporarily added; later, I decorated each with a little black necklace of heat-shrink tubing before poking them through for good. I punched a couple holes through the side of the box for power cables, and added a giant comedy-sized "draw hasp" — that is, a latch for keeping the halves of the box locked together; one of those Pelican-case-style latches where you pull one tab over the other and it snaps down into a locking position. My giant comedy-sized toggle switch was installed next to the giant comedy-sized hasp, bringing the number of chrome-ish protuberances to two and the external assembly to its completion.

I threw an Arduino into the mix just to see what the thing would look like with the lights on, and took the photo above while in the throes of a painful grin. It was, on the one hand, totally premature to say that I had "done it" — on the other hand, it was clearly not premature to say that, and holy shit look at my glowing box.

"That looks exactly like a real thing almost," I marveled.

I cranked the brightness until it hurt. I stared into the light like a Spielberg character.

After taking the bits and pieces back out of the box and sanding everything, I treated the wood. The first thing I did was give everything a couple coats of wood stain, a sticky affair that can be affectionately thought of as kamikaze for brushes; a couple days later, now dried and pungent, the box was attacked with a fork. My idea was to give it an artful coat of faux-antique wear and scratches first, and then cover those bruises with a glaze-y finish on top, in a way that doesn't actually make sense as a replica of antique things but looks cool as sort of a "heightened reality" indulgence. I tore little nooks and scrapes into the wood on all sides, as well as re-sanding the edges and anywhere that would have been "handled" a lot over the "lifetime" of the thing. Two different kinds of damage, and I went in opposing directions with their contrast — the worn-down edges were left brighter than the surroundings, showing the original butter-colored wood instead of the stain; the scrapes and gashes were liberally gooped with black acrylic paint and then immediately wiped, leaving them dark and striking.

I went through a bunch of designs for the logo — at first I was thinking in terms of my invented relic having been a finished product that just happens to be seventy years old, and thus needing a professional period-appropriate logo that would have been professionally applied at the time and weathered since. I've done quite a bit of lettering and sign-painting stuff, and I love the look of those old "Coca-Cola"-logo style image marks, so I started merrily down the path of fanciness before coming to a sudden stop, right after sketching out my third design; my work-in-progress itself was a cooler image than the logo was going to be. The guideline rings looked wonderful with the intersecting scrapes of the text's x-height and base lines; the whole thing felt very authentic and "drawing-board"-y. I wanted to keep it, so I changed my mind: the actual (fake) history of this game was that it was a proof-of-concept that was being passed around the engineering department as a potential future-product for the company that was making it, and someone had slapped this half-assed logo on the side right before presenting the game at a meeting or something, where the company rejected the whole project and this one prototype is all that remains.

When you spend a long time on a project, you start telling yourself stories about it. Whatever. Sold.


http://www.friendsinyourhead.com/arduino/040.jpg


I had been calling this thing the connect fourduino in the previous weeks; I settled on the abbreviation "co-fo-ino" during the design phase because it was fun to play with the "o" shapes, and eventually arrived at the stylization CoFoiNo with the all-important minuscule "i" for the visual balance and hint that it's not a lowercase "L." I'm aware that to someone completely uninitiated it might read as "Co-Foi-No," and I have decided that I'm gonna spend the rest of my life explaining myself anyway, so what the hell.

(If I had this whole process to do over again and could only change one thing, I wouldn't add any color to the logo. Right before I applied the clearcoat, I got nervous about having the logo be totally unvarnished and penciled in a bit of color as a compromise; it still looks fine, but it looked cooler without the filled-in letters.)

I rigged up a little tripod to dangle the box from and went over it several times with clear gloss spray, maybe five or six coats in total. (I have yet to encounter a situation wherein I regretted doing too many clearcoat passes; it has always gotten better with more coats. Be brave.) I didn't do any sanding or polishing between coats, as I wanted to keep a little bit of the natural chunkiness and texture of the wood. I'd spray a coat, wait fifteen minutes, and spray again. The clear coat was the last step in the box-stylization process, and once it was dry, it still looked wet. That's the dream.


http://www.friendsinyourhead.com/arduino/050.jpg



http://www.friendsinyourhead.com/arduino/045.jpg


(The big red button is missing from the control surface; it adds something, I think.)

There's not much drama in customizing a box, but I think it turned out well. It was just an empty thing — the parts that were installed didn't actually do anything — but the big push and little progressions were finally getting me somewhere. It had now been several weeks since I started in on everything, and in the intervening box-time time I had begun to experiment with soldering and circuitry. I had some electrical concepts figured out; I had some electrical experience under my belt. I had the electrical components, and now I had the console. I had a plan.

All the pieces were coming together; the process of diving-in to learn the waters had turned out to be relatively safe after all. Except, fun fact — you know what's not a myth?





Stay tuned

Teague Chrystie

I have a tendency to fix your typos.

Thumbs up +2 Thumbs down

Re: "Radiopunk" // In Which Teague Uses This Forum As A Notebook

http://i.imgur.com/IPgKxoN.gif

The difficult second album Regan

Thumbs up Thumbs down

Re: "Radiopunk" // In Which Teague Uses This Forum As A Notebook

Teague wrote:

You know the problem with customizing a box? There's no drama in it.

...The first thing I did was give everything a couple coats of wood stain, a sticky affair that can be affectionately thought of as kamikaze for brushes; a couple days later, now dried and pungent, the box was attacked with a fork. My idea was to give it an artful coat of faux-antique wear and scratches first, and then cover those bruises with a glaze-y finish on top, in a way that doesn't actually make sense as a replica of antique things but looks cool as sort of a "heightened reality" indulgence. I tore little nooks and scrapes into the wood on all sides, as well as re-sanding the edges and anywhere that would have been "handled" a lot over the "lifetime" of the thing. Two different kinds of damage, and I went in opposing directions with their contrast — the worn-down edges were left brighter than the surroundings, showing the original butter-colored wood instead of the stain; the scrapes and gashes were liberally gooped with black acrylic paint and then immediately wiped, leaving them dark and striking. ...

Sooooo....what you're saying is, you gave it Dino-Damage (tm)

Witness me!

Thumbs up Thumbs down

Re: "Radiopunk" // In Which Teague Uses This Forum As A Notebook

Sweet Jesus.

Thumbs up Thumbs down