What Is, Is
April 10, 2025
The way a thing works is the way to work it. When you do not know how it works, and you can find no one to tell you, then you are likely to learn it by discovering for yourself the ways in which the thing does not work.
Finding out this way how something works exercises the mind in the way that chopping wood keeps you warm when you are outdoors on a cold day. Why did you go outside on a cold day? Because you need the wood to keep the stove going, to keep the house warm, because it it cold outside!
The exertion holds a worthwhile end in view: the satisfaction of resting comfortably in front of a fire of one's own fueling, gazing into the flames.
Writing code can be like that, as a recent experience reminded me.
Roger Wagner asked me to write a library of short programs to communicate between his invention, the MakerPort, and a memory device called an electrically eraseable programmable read-only memory, or eeprom. An eeprom is like a tiny thumb drive for saving information and later retrieving it.
The programs for Roger are to be written in a special language called MicroBlocks, invented by a mutual friend of ours named John Maloney.
I want to pause here to say that people like John and Roger truly devote themselves to making our world a better place. Here are links to their web sites:
- MakerPort by Roger Wagner: https://makerport.fun/
- MicroBlocks by John Maloney: https://microblocks.fun/
It gives me much pleasure to help out when I can.
The eeproms that we can attach to a MakerPort use a method called Inter-Integrated Communications, or I2C, for moving data back and forth. John includes some very nice instructions in the MicroBlocks language for working with I2C. You save information into a list then use one of the provided instructions to ‘write’ the list to the eeprom.
But wait. MicroBlocks handles some kinds of data, such as large numbers and text that people can read, in ways that differ from what works with I2C. I won't go into details here. This is a diary, not a technical tutorial.
Suddenly I felt myself out in the cold. I want to store words like "Hello, Roger" or "Thank you, John" or numbers like 2025. Put them in a list, as the MicroBlocks instructions suggest, which is easy to do, then send the list to the eeprom, and Splat! Get an error message about how I2C data is limited to 0-255.
Hmmm... It turns out that I do not know how the MicroBlocks I2C instruction works for writing a list to an eeprom. I shall have to chop wood before I can sit in front of the cozy fire.
I do know something about I2C and eeproms from other languages, particularly from the C and C++ languages. It helps to know that those languages break their data down into bytes, each of which can be expressed as a number in the range 0 to 255.
After a while I figure out that the error message was a clue. The MicroBlocks instruction for writing a list to an eeprom works only when the items in that list are bytes. Data in other, different forms need to be converted, or subdivided, into bytes. Then you put the bytes into the list for writing out to the eeprom.
Reading data back in from the eeprom reverses the procedure. You receive bytes, which you then convert or recombine into their original form.
Chop, chop, chop, chop, chop. I found and learned the instructions in MicroBlocks for doing these transformations with data. Now, the words and numbers go out and come back quite nicely through the I2C instructions.
One could hope to have found it spelled out somewhere, about the need to chop data into bytes for I2C purposes in the MicroBlocks language. Maybe I just stopped looking for the explanation too soon.
What is, is. What is not, is not. And the way a thing works is the way to work it. One way to find out how it works is to find all the ways it does not.
It reminds me of a parable about Thomas Edison inventing his incandescent-filament light bulb. Day after long and fruitless day, Thomas sits at his bench trying different combinations of materials. Someone asks how many he has tried. “Ten thousand”," he replies.
“How do you cope with so much failure?”
“What failure? I have discovered ten thousand things that do not work!”
I speculate that Mr. Edison probably took pleasure in figuring things out for himself.
Just like me. It's one of the warmest feelings I know.
I probably will put this MicroBlocks eeprom work product online at Github in the near future. When I do I will add a link to it here.