One-byte binary LED display

See Binary On Your Breadboard

When you’re debugging a board which has an ESP32, Raspberry Pi, or Arduino, it’s easy to slap on a small LCD display or connect via WiFi to see what’s wrong. At least, that’s what the kids are doing. But what if you’re old-school or you don’t have one of those pimped-out, steroid-filled boards? A resistor and an LED will often suffice. Powering the LED means one thing and not powering it means another. And with seven more LEDs you can even display 0-255 in binary.

[Miguel] is clearly in the latter camp. To make debugging-with-LEDs easy, he’s come up with an 8-LED board complete with resistors. He’s even included the Gerber files needed for you to make your own. One row of pins are all connected together and the other row are not. So whether you’re using common cathode or common anode depends on how you orient the LEDs when you solder them in place. You might perhaps have one board of each type at the ready.

But who are we kidding? This is just plain fun to have on a breadboard. Show your prototype doohickey to a friend and you know they’ll be drawn to the little binary counter in the corner pulsing 42 or counting down until it starts flashing 255.

At risk of getting too feature-rich, you could then add two keys for a binary keyboard or add more LEDs to display 32-bit binary Unix Epoch time and see how long until your friends figure that one out.

Continue reading “See Binary On Your Breadboard”

Learn To Count In Seximal, A Position Above The Rest

Believe it or not, counting is not special. Quite a few animals have figured it out over the years. Tiny honeybees compare what is less and what is more, and their brains are smaller than a pinky nail. They even understand the concept of zero, which — as anyone who has had to teach a toddler knows — is rather difficult to grasp. No, counting is not special, but how we count is.

I don’t mean to toot our own horn, but humans are remarkable for having created numerous numeral systems, each specialized in their own ways. Ask almost anyone and they will at least have heard of binary. Hackaday readers are deeper into counting systems and most of us have used binary, octal, and hexadecimal, often in conjunction, but those are just the perfectly standard positional systems.

If you want to start getting weird, there’s balanced ternary and negabinary, and we still haven’t even left the positional systems. There’s a whole host of systems out there, each with their own strengths and weaknesses. I happen to think seximal is the best. To see why, we have to explore the different creations that arose throughout the ages. As long as we’ve had sheep, humans have been trying to count them, and the systems that resulted have been quite creative, if inefficient.

Continue reading “Learn To Count In Seximal, A Position Above The Rest”

Basic Sequencer For Your Synth Rack

Sequencers are useful for bringing regular structure to your music, particularly if you enjoy noodling around with rackmount synthesizers. [little-scale] is here to share an ADC Binary Gate sequencer for your setup.

In a quest for ever greater minimalism, the build relies on a barebones ATMega328p without an external oscillator. Instead, the chip’s internal RC oscillator is used instead. It’s possible to still use this with the Arduino IDE, as [little-scale] shares here.

The music production begins with a clock input signal, which is patched in from elsewhere in the rack synth. The sequencing is controlled with potentiometers. There are four potentiometers, and four corresponding output channels.  The pots are all read with the onboard analog to digital converters, and the position transformed into an 8-bit value, from 0 to 255. Our best understanding is that the 8-bit number is then used as the sequence to follow. For example, if the potentiometer is set to 255, which is 11111111 in binary, the sequencer will trigger on every beat. If instead the potentiometer was turned to around 2/3rds of the maximum, and the ADC reads a value of 170, in binary this is 10101010 which would trigger on every second beat.

It’s an interesting way to sequence several channels with the bare minimum of input devices. While it may not be the most intuitive system, it really suits the knob-and-dial noodling so relished by rackmount fanatics. Be sure to check out the video below for [little-scale]’s rackmount sounds and impressively pretty videography.  Never before did breadboards look so good.

New to rack mount synths? Check this one out.

 

 

 

Injecting Code Into Mouse Firmware Should Be Your Next Hack

Here’s a DEF CON talk that uses tools you likely have and it should be your next hacking adventure. In their Saturday morning talk [Mark Williams] and [Rob Stanely] walked through the process of adding their own custom code to a gaming mouse. The process is a crash course in altering a stock firmware binary while still retaining the original functionality.

The jumping off point for their work is the esports industry. The scope of esporting events has blown up in recent years. The International 2016 tournament drew 17,000 attendees with 5 million watching online. The prize pool of $20 million ($19 million of that crowdfunded through in-game purchases) is a big incentive to gain a competitive edge to win. Contestants are allowed to bring their own peripherals which begs the questions: can you alter a stock gaming mouse to do interesting things?

The steelseries Sensei mouse was selected for the hack because it has an overpowered mircocontroller: the STM32F103CB. With 128 KB of flash the researchers guessed there would be enough extra room for them to add code. STM32 chips are programmed over ST-Link, which is available very inexpensively through the ST Discovery boards. They chose the STM32F4DISCOVERY which runs around  $20.

Perhaps the biggest leap in this project is that the firmware wasn’t read-protected. Once the data, clock, and ground pads on the underside of the board were connected to the Discovery board the firmware was easy to dump and the real fun began.

They first looked through the binary for a large block of zero values signifying unused space in flash. The injected firmware is designed to enumerate as a USB keyboard, open Notepad, then type out, save, and execute a PowerShell script before throwing back to the stock firmware (ensuring the mouse would still function as a mouse). Basically, this builds a USB Rubber Ducky into stock mouse firmware.

There are a few useful skills that make taking on this project a worthwhile learning experience. To compile your custom code correctly you need to choose the correct offset address for where it will end up once pasted into the firmware binary. The vector table of the original code must be rewritten to jump to the injected code first, and it will need to jump back to the mouse execution once it has run. The program flow on the left shows this. Both of these jumps require the program counter and registers to be saved and restored. The ARM stack is subtractive and the address will need to be updated to work with the added code.

The talk ended with a live demo that worked like a charm. You can check out the code in the MDHomeBrew repo. In this case the PowerShell script adds keyboard shortcuts for DOOM cheats. But like we said before, the experience of getting under the hood with the firmware binary is where the value will be for most people. With this success under your belt you can take on more difficult challenges like [Sprite_TM’s] gaming keyboard hack where the firmware couldn’t easily be dumped and an update binary was quite obsfucated.

New Take On The Binary Clock

By now it might seem like there’s no new way to build a binary clock. It’s one of the first projects many build to try out their first soldering irons, so it’s a well-traveled path. Every now and then, however, there’s a binary clock that takes a different approach, much like [Stephen]’s latest project which he calls the byte clock.

The clock works by dividing the 24-hour day into half and using an LED to represent this division, which coincidentally works out to representing AM or PM. The day is divided in half over and over again, with each division getting its own LED. In order to use this method to get one-second resolution it would need 16 LEDs, but since that much resolution isn’t too important for a general-use clock, [Stephen] reduced this to eight.

Additionally, since we’re in the Internet age, the clock has built-in WiFi courtesy of a small version of Python called WiPy which runs on its own microcontroller. A real-time clock rounds out the build and makes sure the clock is as accurate as possible. Of course an RTC might not have the accuracy as some other clocks, but for this application it certainly gets the job done.

This Binary Keyboard Is For ASCII Purists

So, you’re a keyboard enthusiast. The ‘board that came from Dell, HP, or whoever made your computer is just not for you. You have an ancient IBM, a decal-free Das Keyboard, or another similarly esoteric text input device. Your typing can be heard three blocks away as the unmistakable clack of bent-spring switches reverberates around you, but you don’t care because you’re in the Zone.

No keyboard can be as high-end as the one you already have, your position in the hierarchy of text entry is assured. But then along comes [Chris Johnston] with his project, and suddenly your desktop looks very cluttered. It’s a binary keypad with only a 0 key, a 1 key, and an OLED display. All input is as a series of binary bytes, so as a hardcore binary typist you’ll need to know your ASCII.

Behind the keys is an Arduino Pro Micro acting in USB HID mode, and running the code you can download from the GitHub link above. It’s a gloriously pointless input device, but we’re sure you’ll agree it has something of the 00110001 00110011 00110011 00110111 about it.

If you think you may have seen this before on Hackaday then you’re not quite right. We have had a binary keypad in the past, but that one had a return key and thus had three keys. This one’s a 2-key ‘board for binary purists.

[via /r/mechanicalkeyboards/]

Binary Keyboard Is The Purest Form Of Input Device

You may be a hardcore keyboard aficionado whose buckled-spring switches will be pried from your cold dead hands, but there is a new model on the street that relegates your blank-key Das Keyboard or your trusty IBM Model M to the toy chest.

The new challenger comes from Reddit user [duckythescientist], who has created a minimalist three-key binary keyboard. It features a 0 key, a 1 key, a return key, and nothing else. Characters are entered as ASCII or Unicode, and the device emulates either a QWERTY or Dvorak keyboard layout to the host computer’s USB interface. It couldn’t be a simpler layout to learn, though we’d concede that not everyone has the entire binary Unicode table memorised.

The keys are mounted in a custom 3D printed case, and the electronics come from the creator’s own “tinydev” board based on an ATtiny85. All the code is available in a GitHub repository, and there is a very short video of its Unicode ability below the break.

Continue reading “Binary Keyboard Is The Purest Form Of Input Device”