3D Blinky Tile Structures

Majorly stoked to discover that Blinky Tiles can be attached in 3D structures! Just wanted to share this with everyone, as all the images I’ve been able to find of Blinky Tile sculptures have them in 2D arrangments – that is, only one tile attached to each edge. I had some old leftover tiles and wanted to see if I could stick an open dodecahedron onto one that was complete. Unfortunately, my engineering skills weren’t good enough to allow me to predict if this would work or not, but so far, so good. I’ve attached an image so you can see what I mean.

 

blinkycat.jpg

 

Advertisements

LaTex

This is a test post demonstrating the use LaTeX code to display mathematical formulae; specifically (hopefully) preparation for an article later on which will discuss the relationship between Markov chains and linear dynamical systems (hint: they’re basically the same thing.)

LaTeX, if you don’t know already, is a really nice system for typesetting, including mathematical formulae, and LaTeX software provides the means to display it on-screen or in printable form (like pdfs). It was originally invented by the legendary Donald Knuth, and later was extended by Leslie Lamport. (Supposedly, it is always written as \LaTeX or “LaTeX,” and is pronounced either as “Lay-Tek” or “Lah-Tek” (ideally with a Greek \chi (chi) sound, like “loch” or “Bach”; never “Lay-Tex,” like rubber.)

I discovered that WordPress has the ability to parse LaTeX for you, so it’s unnecessary to fool around with LaTeX editors and LaTeX-to-image conversion utilities (which I spent several hours doing until I discovered that WordPress would do it all for me!).

While I was at it, I was also trying to see what I could do about configuring Atom (my favorite editor) to display LaTeX; that turned out to be fairly complicated (at least for me). You can read about that here, if you like.

This is one of the places where I was able to find instructions for inserting LaTeX code into WordPress blog pages: https://kogler.wordpress.com/2008/03/21/latex-multiline-equations-systems-and-matrices/

Here are a few examples:

\LaTeX

\LaTeX

\LaTeX

\LaTeX

\begin{array}{lcl} v & = & \left ( \begin{array}{c} v_{1} \\ v_{2} \\ v_{3} \end{array} \right) \\ \\  v^T & = & \left ( \begin{array}{ccc} v_{1} & v_{2} & v_{3} \end{array} \right)  \end{array}

\begin{array}{lcl} v^Tv & = & \left ( \begin{array}{ccc} v_{1} & v_{2} & v_{3} \end{array} \right)  \left ( \begin{array}{c} v_{1} \\ v_{2} \\ v_{3} \end{array} \right)\\ \\ & = & v_{1}^2 + v_{2}^2 + v_{3}^2\\ \\ & = & \|v\|^2 \end{array} \\ \\ \\ \\  \|v\| = \sqrt{v^Tv} = \sqrt { \left ( \begin{array}{ccc} v_{1} & v_{2} & v_{3} \end{array} \right)  \left ( \begin{array}{c} v_{1} \\ v_{2} \\ v_{3} \end{array} \right) } = \sqrt{v_{1}^2 + v_{2}^2 + v_{3}^2}

vv^T = \left ( \begin{array}{c} v_{1} \\ v_{2} \\ v_{3} \end{array} \right)  \left ( \begin{array}{ccc} v_{1} & v_{2} & v_{3} \end{array} \right) = \left ( \begin{array}{ccc} v_{1}v_{1} & v_{1}v_{2} & v_{1}v_{3} \\ v_{2}v_{1} & v_{2}v_{2} & v_{2}v_{3} \\ v_{3}v_{1} & v_{3}v_{2} & v_{3}v_{3} \end{array} \right)

v \times v = \left ( \begin{array}{c} v_{1} \\ v_{2} \\ v_{3} \end{array} \right)  \times  \left ( \begin{array}{c} v_{1} \\ v_{2} \\ v_{3} \end{array} \right) = \left ( \begin{array}{ccc} v_{2}v_{3} & - & v_{3}v_{2}\\ v_{3}v_{1} & - & v_{1}v_{3}\\ v_{1}v_{2} & - & v_{2}v_{1} \end{array} \right) = 0

A = \left [ \begin{array}{ccc} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{array} \right]

A = \left ( \begin{array}{ccc} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{array} \right)

x_{t + 1} = A_t x_t, t = 1, 2, 3, ...\\\\ x_{t + 1} = A_t x_t + B_t u_t + c_t

T(v) = f(v) = Av = \left ( \begin{array}{ccc} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{array} \right)  \left ( \begin{array}{c} v_{1} \\ v_{2} \\ v_{3} \end{array} \right) \\ \\ \\ T(v) \hspace{25mm} = \left ( \begin{array}{c} a_{11}v_{1} + a_{12}v_{2} + a_{13}v_{3} \\ a_{21}v_{1} + a_{22}v_{2} + a_{23}v_{3} \\ a_{31}v_{1} + a_{32}v_{2} + a_{33}v_{3} \end{array} \right)

Ax = b \\ \\ x = A^{-1}b \\ \\ A = \left ( \begin{array}{cc} a_{11} & a_{12} \\ a_{21} & a_{22} \end{array} \right) \\ \\ \\ A^{-1} = \frac{1}{a_{11}a_{22} - a_{12}a_{21}} \left ( \begin{array}{cc} a_{22} & -a_{12} \\ -a_{21} & a_{11} \end{array} \right)

In case you’re interested, this is what some of the embedded code looks like:

$ latex
\LaTeX&bg=333333&fg=ffffff&s=4 $

$ latex
\LaTeX&bg=333333&fg=aaaaaa&s=4 $

$ latex A =
\left [
\begin{array}{ccc}
a_{11} & a_{12} & a_{13} \\
a_{21} & a_{22} & a_{23} \\
a_{31} & a_{32} & a_{33}
\end{array}
\right]
&bg=333333&fg=ffffff $

In order to make it display properly, you need to:

a.) remove the spaces between the dollar signs ($) and the first and last symbols in the string.

b.) insert the code in text mode (which can be selected by clicking on the little white “T” in the black box in the menu displayed in visual mode).

You can then go to preview to actually see how the formulas display.

Notes:
1. I have found other useful resources for learning TeX and LaTeX; I will try to collect and post some of them later on.

2. In attempting to format the equations, and provide nice spacing, I have discovered that commands like “/hspace*{20mm}” definitely do not work, and that at least one solution is to use nested array statements, as in:

\begin{array}{lcl}
.
.
.
\begin{array}{ccc}
.
\end{array}
.
.
.
\end{array}

Ransom

Democrats should just pay the ransom and open the government. The sooner, the better.

It might seem like a bad idea, but actually it’s not. The wall is useless, but that’s no reason not to build it. John Maynard Keynes said that it would be economically beneficial to pay people to dig holes and fill them up again; similarly, we can pay people to build the wall and then tear it down in a few years, receiving twice the benefit.

As absurd as the whole thing might seem, what is more absurd is playing into the hands of the Trump movement by stubbornly opposing the wall. The wall dispute keeps the government closed, which is exactly what they want.

Too many people have missed the point of all this – it was never about the wall. The wall, as usual, is a distraction.

Trump is a clown and a charlatan, and most of his antics are themselves nothing more than distractions. But the wall in this instance has a real purpose.

Trump is supported by a movement that began with Reagan, and only ends when every service now provided by government is purchased through private contracts.

We need to understand this: these people don’t just want to shut the government down; they want to burn it down.

America

I’ve heard it mentioned occasionally that DJT hasn’t really delivered on his promises to the base, and that seems to promote a bit of head-scratching as to why they still support him. I would suggest that he has, in fact, been giving them a little something, and it goes a long way with this particular community. I know this, because I grew up with these people, and I know them quite well.

What I mean is this – the MAGA movement has a magic formula. There is a media character “Trump,” who is an amusing charlatan, and most of what he says and tweets is nonsense; however, there are a few core issues:

1. Anti-immigrant (this one is big)

2. Pro-gun (this one is *very* big)

3. Anti-abortion (this one plays well with the Religious Right)

4. Anti-environment (this one is complex, but mostly has to do with the intersection of the interests of the fossil fuels industry and the Religious Right. One of them has a financial interest, and the other has a very interesting take on the environment; in short, they want the world to end.)

As long as he is perceived as being on the “right” side (as in “hard-right”) of the NRA, hammers the immigrants (kids in concentration camps has good optics with a certain demographic) and puts judges like Gorsuch and Kavanaugh on the Supreme Court, his base support is rock-solid.

The democrats won’t impeach him because they don’t want dozens of Malheur/Bundy-style incidents erupting around the country. I strongly suspect that the only thing that will bring him down is a stock-market crash – that’s when Fox pulls the plug (oligarchs like money more than they hate immigrants, or even love guns).

Cheers, and Happy Holidays!

Arduino

I’m calling this post “Arduino,” but it’s really about hardware and software art. Matt Mets and the rest of the team at Blinkinlabs has created  a wonderful product called the “BlinkyTile.” This is a system of pentagonal and hexagonal PCBs (printed circuit boards) with attached LEDs (light-emitting diodes). I first became interested in making art with microcontrollers and and LEDs when I attended Burning Man in 2013 and saw what a friend of my son was able to do with a string of lights and a controller that he brought to the event. I was even more excited last year when I saw some beautiful objects, including one by an engineer and maker who goes by the name of Bunnie. He created a polyhedral sculpture, the Polyhedrone, that is constructed from rhomboidal or kite-shaped PCB/LED tiles. These are assembled into a type of Catalan solid called a deltoidal hexecontahedron. The BlinkyTiles make it possible to construct small dodecahedrons, and that it what I have been working with.

The kit that Blinkinlabs sells includes a microcontroller called the LightBuddy, which come pre-programmed, but is a little hard for a novice like myself to program. It is *very* helpful, however, for getting started and also for re-programming addresses on the individual boards (which can be useful sometimes).

What I decided to do was use an Arduino Leonardo (that I originally bought for a robot), as well as an Adafruit Metro Mini (which can be programmed like an Arduino Uno). I program these with the Arduino IDE, which I learned to use when I built a some programmable LED goggles a couple of years ago. (See my previous post about this if you are interested; it actually goes into a lot of detail about setting up the programming environment, etc.)

What’s really exciting (for me, anyway), is that along the way I acquired an IR receiver module and a small hand-held remote control. I was then able to figure out how to use these to control the lights on the assembled dodecahedron.

Unfortunately, I don’t have any videos of the finished product, and won’t, until my new ir receivers come in the mail (Hint: be careful to keep your VS and the GND straight when you plug these devices into the board).

In the meantime, I do have some code to share. It’s not the most beautiful code in the world, and it’s not very well-commented, but it gets the job done, and hopefully it may be of use to someone trying to do something similar.

I need to give credit where credit is due, particularly to Daniel Garcia and Mark Kriegsman of the FastLED Project, and Chris Young, the creator of IRLib2. I borrowed and re-worked some of the code they provided, which saved me a great deal of time. Chris Young also has a great tutorial on IR communication at the Adafruit web site, which was invaluable.

I’m attaching a photo of the set-up I’ve been using, just to give people an idea of what I’m talking about (and see the elegant beauty of the BlinkyTiles themselves). Notice that in this photo the IR receiver is *not* connected.

There are a number of technical considerations regarding total current and power when you start adding larger numbers of LEDs. I’ll just mention that it’s generally a good idea, IMHO, to limit the current to each LED to no more than 7mA, which is about a third of the maximum current draw. (I actually have been keeping it down to as little 2.35mA, which is an RGB value of 30, with good results.) This will help simplify current/power considerations for small projects. Note that each of the LED modules at the center of a PCB tile is actually a combination of 3 LEDs (1 blue, 1 red, 1 green), making for a total of 12 X 3 = 36 LEDs altogether for each 12-sided dodecahedron. This all really makes a lot more sense when you just start building and using these things. I plan to be at the Raspberry (Pi) Jam in Seattle on August 8 and will try to bring some, so, hopefully, if you want to, you can see them there.

IMG_1476

 

Leonardo

A little while ago I acquired an Arduino Leonardo, mainly because I prefer its micro-USB to the USB-B connector on the Uno. I only recently started programming it, but I discovered that a certain amount of preparation may be required.

There have been reports of glitchiness with downloading to the Leonardo in Ubuntu, and I gathered together the solutions that I found.

For my set-up, which is a Toshiba Satellite running (still) Ubuntu 14.04 (Trusty Tahr), and Arduino IDE 1.8.5, the following seems to get everything working together.

First, connect the Leonardo to your computer and take a look at the device:

ls -l /dev/ttyUSB0

You should see something like this: (Note that you will not see this if the Leonardo or a similar device is not connected.)

crw-rw---- 1 root dialout 188, 0 2009-07-04 15:23 /dev/ttyUSB0

Now, add yourself/user to the dialout group:

sudo usermod -aG dialout <yourUserName>

(or, equivalently)
sudo usermod -a -G dialout <yourUserName>

Change permissions: (this may not be necessary if user has been added to dialout group)

sudo chmod 666 /dev/ttyUSB0 (for USB or /dev/ttyACM0 for serial)

Uninstall/purge modemmanager:

sudo apt-get --purge remove modemmanager

Uninstall/purge brltty and its dependent packages: (deletes app, configuration and/or data files, and dependencies)

sudo apt-get purge --auto-remove brltty

(brltty, as I understand it, is an app for people who are visually impaired. modemmanager, is, I guess, just what it sounds like. Fortunately, most people aren’t going to miss either one of those things. If you need them, it looks like they can interfere with the Leonardo, so you may be better off using the Uno, or something like it.)

It might not be necessary to do every one of these steps, but after going going through this process, I’ve been able to program and download to the Leonardo without any problems.

Dharma

Yesterday I read a nice interview with Allan Badiner on the subject of psychedelics and Buddhism. (I must confess that I was not previously familiar with him and was inspired to learn more after seeing a photo of him with my good friend Yevgeniy Gelfand.) I’d like to quote a couple of paragraphs that made a very strong impression on me:

“I’m actually quite conservative on the subject, or at least in the middle. I’m not a fan of being on a chemically dependent spiritual path. Early experiences I had with psychedelics led to an intense interest in Buddhism and enlightenment.  As time went on, my interest in Buddhism became less about reaching a goal, as it was about fully enjoying the present moment, making some contribution to others, and not expecting more.

Underemphasized and left unmentioned by many teachers (Thich Nhat Hanh being a notable exception) is that, even short of full enlightenment, the state of being relaxed, present, and aware concurrently with following an ethical path of harmlessness, produces a very pleasurable feeling and a durable contentment.  While it is occasionally punctuated with the inevitable pains of life, it is not transient, nor is it reliant or dependent on substances.”

Here’s a link to the whole interview:

https://www.lionsroar.com/on-the-buddhism-beat-studying-american-buddhism-and-psychedelics-keep-on-truckin-allan-hunt-badiner/