Code Craft – Embedding C++: Timing Virtual Functions

Embedded C developers shy away from C++ out of concern for performance. The class construct is one of their main concerns. My previous article Code Craft – Embedding C++: Classes explored whether classes cause code bloat. There was little or no bloat and what is there assures that initialization occurs.

Using classes, and C++ overall, is advantageous because it produces cleaner looking code, in part, by organizing data and the operations on the data into one programming structure. This simple use of classes isn’t the raison d’etre for them but to provide inheritance, or more specifically polymorphism, (from Greek polys, “many, much” and morphē, “form, shape”).

Skeptics feel inheritance simply must introduce nasty increases in timing. Here I once more bravely assert that no such increases occur, and will offer side-by-side comparison as proof.

Continue reading “Code Craft – Embedding C++: Timing Virtual Functions”

Retrotechtacular: A Mechanical UART

We’ve heard it said that no one invented the old mechanical Teletype. One fell from the sky near Skokie, Illinois and people just duplicated them. It is true these old machines were similar to a modern terminal. They sent and received serial data using a printer instead of a screen. But inside, they were mechanical Rube Goldbergs, not full of the electronic circuits you’d think of today.

Teletype was the best-known name, but there were other mechanical monster terminals out there. [Carsten] recently took some pictures of his 99 pound Olivetti mechanical terminal. According to him, there’s only one electronic component within: a bistable solenoid that reads the data. Everything else is mechanical and driven with a motor that keeps everything at the right baud rate (110 baud).

Like the Teletype, it is a miracle these things were able to work as well as they did. Lacking a microcontroller, the terminals could respond to an identity request by spinning a little wheel that had teeth removed to indicate which letters to send (TeleType used a similar scheme). Things that are simple using today’s electronics (like preventing two keys pressed at once from being a problem) turned out to be massive design challenges for these old metal monsters.

Turns out that when [Carsten] last fired the terminal up, a capacitor finally gave up its magic smoke. He plans to fix it, though, and as long as it isn’t a mechanical problem, we bet he will.

We’ve talked about Teletypes a few times in the past, including using them for text messaging and even Twitter.

Is That Google In Your Pants?

Google’s Project Jacquard is tackling the age old gap between controlling your electronic device and touching yourself. They are doing this by weaving conductive thread into clothing in the form of a touch pad. In partnership with Levi Strauss & Co., Google has been designing and producing touch interfaces that are meant to be used by developers however they see fit.

touch-sensitive-jeans-thumbThe approach that Project Jacquard has taken from a hardware standpoint is on point. Rather than having an end user product in mind and design completely towards that goal, the project is focused on the interface as its product. This has the added benefit of endless varieties of textile interface possibilities. As stated in the video embedded after the break, the conductive touch interface can be designed as a visibly noticeable difference in material or seamlessly woven into a garment.

As awesome as this new interface may seem there are some things to consider:

  • Can an unintentional brush with another person “sleeve dial” your boss or mother-in-law?
  • What are the implications of Google putting sensors in your jeans?
  • At what point is haptic feedback inappropriate? and do we have to pay extra for that?

We’ve covered e-textiles before from a conductive thread and thru hole components approach to electro-mechanical implementations.

Continue reading “Is That Google In Your Pants?”