There are applications you can download for your smartphone that can “roll” an arbitrary number of dice with whatever number of sides you could possibly want. It’s faster and easier than throwing physical dice around, and you don’t have to worry about any of them rolling under the couch. No matter how you look at it, it’s really a task better performed by software than hardware. All that being said, there’s something undeniably appealing about the physical aspect of die rolling when playing a game.
Luckily, [Paul Klinger] thinks he has the solution to the problem. His design combines the flexibility of software number generation with the small form factor of a physical die. The end result is a tiny gadget that can emulate anything from a 2 to 64 sided die with just 6 LEDs while remaining as easy to operate as possible. No need to tap on your smartphone screen with Cheetos-stained hands when you’ve got to make an intelligence check, just squeeze the Universal Electronic Die and off you go. Granted you’ll need to do some binary math in your head, but if you’re the kind of person playing D&D with DIY electronic dice, we think you’ll probably be able to manage.
The 3D printed case that [Paul] came up with for his digital die is very clever, though it did take him awhile to nail it down. As shown in the video after the break, it took seven iterations before he got the various features such as the integrated button “flaps” right. There’s also a printed knob to go on the central potentiometer, to make it easier to select how many sides your virtual die will have.
In terms of the electronics, the design is actually quite simple. All that lives on the custom PCB is a ATtiny1614 microcontroller, the aforementioned LEDs, and a couple of passive components. A CR2032 coin cell powers the whole operation, and it should provide enough juice for plenty of games as it’s only turned on when the user is actively “rolling”.
We’ve seen a number of very impressive electronic dice projects over the years, and it doesn’t look like the trend is slowing down anytime soon. Of course, if you absolutely must hear those physical dice rolling, we can help you with that too.
If you are familiar with binary, what would you need to teach someone who only knows decimal? If you do not know how to count in binary, let us know if the video below the break helps you understand how the base-2 number system works. If learning or counting binary is not what you are interested in, maybe you can appreciate the mechanics involved with making a counter that cycles through all the ones and zeros (links to the video shown below). The mechanism is simple enough. A lever at the corner of each “1” panel is attached off-center, so it hangs when it is upside-down, then falls to the side when it is upright, so it can swivel the adjacent panel.
Perhaps this is a desktop bauble to show off your adeptness at carpentry, or skills with a laser cutter, or 3D printer. No matter what it is made out of, it will not help you get any work done unless you are a teacher who wants to demonstrate the discrete nature of binary. If wood and bits are up your alley, we have a gorgeous binary driftwood clock to feast your eyes on. Meanwhile if analog methods of working digital numbers suit you, we have binary math performed with paper models.
Continue reading “A Nibble And A Half Of Wooden Bits”
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”
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”
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.
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.
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.