Your NES Classic Mini Controller, On Your Desktop Computer

The NES Classic Mini was one of the earlier releases in what became a wider trend for tiny versions of classic retro consoles to be released. Everybody wanted one but numbers were limited, so only the lucky few gained this chance to relive their childhood through the medium of Donkey Kong or Mario Brothers on real Nintendo hardware. Evidently [Albert Gonzalez] was one of them, because he’s produced a USB adapter for the Mini controller to allow it to be used as a PC peripheral.

On the small protoboard is the Nintendo connector at one end, an ATtiny85 microcontroller, and a micro-USB connector at the other. The I2C interface from the controller is mapped to USB on the ATtiny through the magic of the V-USB library, appearing to the latter as a generic gamepad. It’s thought that the same interface is likely to also work with the later SNES Classic Mini controller. For the curious all the code and other resources can be found in a GitHub repository, so should you have been lucky enough to lay your hands on a NES Classic Mini then you too can join the PC fun.

The mini consoles were popular, but didn’t excite our community as much as could be expected. Our colleague Lewin Day tool a look at the phenomenon last summer.

A Big Set Of Logic Gates For Teaching The Basics

Teaching students about logic gates is often done in two parts, once on the whiteboard for the theory, and again on the breadboard for the practice. [shurik179] wasn’t a fan of the abstraction between easy-to-understand symbols on the whiteboard, and small IC packages full of many gates in reality. Instead, he built a set of real-world logic gates that can be wired together as a teaching tool.

Each “gate’ consists of a PCB roughly the size of a business card that features LEDs to indicate the state of its inputs and outputs, and a silkscreen indicating the name and symbol of the gate in question. There’s also a master PCB, which features three seed values, A, B, and C, to feed into the system. Students can set these values to 1 or 0, and feed them into the gates, which are wired together with 3-conductor servo cables, and observe the input on the built-in LEDs.

It’s a great way to demonstrate logic gates in the classroom. The design also allows the PCBs to be flipped over to show the actual electronic components responsible for implementing the logic, serving as a great bridge towards better understanding of real electronic design. Of course, it’s not the only way to learn – even Fallout 4 has a fully fledged logic toolkit these days!

An Alternator Powered Electric Bicycle Gives Rotor Magnetic Field Insight

For anyone involved in the construction of small electric vehicles it has become a matter of great interest that a cheap high-power electric motor can be made from a humble car alternator. It’s a conversion made possible by the advent of affordable three-phase motor controllers, and it’s well showcased by [austiwawa]’s electric bicycle build video (embedded below).

The bike itself is a straightforward conversion in which the motor powers the rear wheel via an extra sprocket. He tried a centrifugal clutch with limited success, but removed it for the final version. Where the interest lies in this build is in his examination of Hall effect sensor placement.

Most alternator conversions work without sensors, though for better control it’s worth adding these magnetic sensors to allow the controller to more directly sense the rotation. He initially placed them at the top of the stator coils and found them to be ineffectual, with the big discovery coming when he looked at the rotor. The electromagnet in the rotor on a car alternator has triangular poles with the field concentrated in the centre of the stator, thus a move of the sensors to half way down the stator solved the problem. Something to note, for anyone converting an alternator.

Should you wish to give it a try, a year ago we published a primer on turning car parts into motors.

Continue reading “An Alternator Powered Electric Bicycle Gives Rotor Magnetic Field Insight”

When Appliance Hackers Hit The Music Scene

The art-music-technology collective “Electronicos Fantasticos!” (commonly known as Nicos) is the brain child of artist/musician [Ei Wada] in Japan. They revive old, retired and out-dated electrical appliances as new “electro-magnetic musical instruments” creating not just new ways to play music, but one that also involves the listener as a musician, gradually forming an interactive orchestra. They do this by creatively using the original functions of appliances like televisions and fans, hacking them in interesting ways to produce sound. The project started in the beginning of 2015, leading to the creation of a collaborative team — Nicos Orchest-Lab — around the end of that year. They have since appeared in concerts, including a performance at “Ars Electronica”, the world’s largest media arts festival in 2019.

For us hackers, the interesting bits can be found in the repository of their Work, describing sketchy but tantalising details of the musical instruments. Here are a few of the more interesting ones, but do check out their website for more amazing instruments and a lot of entertaining videos.

CRT-TV Gamelan – A percussion instrument made from old CRT monitors. Coloured stripes projected on the screen cause changes in static-electricity picked up by the players hands, which then propagates to an electrical coil attached to their foot. This signal is then patched to a guitar amplifier.

Electric Fan Harp – They take out the fan blade, and replace it with a “coded disk” containing punched holes. Then they shine a bulb from under the rotating disk, and the interrupted light is picked up by an optical receiver held by the player. Controlling the fan speed and the location of the receiver pickup, they can coax the fan to produce music – based on the idea “What if Jimi Hendrix, the god of electric guitars, played electric fans as instruments?”

Barcoder – This one is quite simple but produces amazing results, especially when you pair up with another Barcoder musician. The output of the barcode reader is pretty much directly converted to sound – just wave the wand over printed barcode sheets. And it works amazingly well when pointed at striped shirts too. Check out the very entertaining videos of this gizmo. This led to the creation of the Barcodress – a coded dress which creates an interactive music and dance performance.

 

The Striped Shirtsizer

Striped Shirtsizer – This one is a great hack and a synth with a twist. A camera picks up video signals, which is then fed to the “Audio” input of an amplifier directly. In the video on the project page, [Ei Wada] explains how he accidentally discovered this effect when he wrongly plugged the “yellow” video out connector to the audio input of his guitar amplifier. At an outdoor location, a bunch of people wearing striped shirts then become an interactive musician-audience performance.

The Kankisenthizer

Kankisenthizer a.k.a Exhaust Fancillator  – This one consists of an array of industrial exhaust fans – although one could just as well use smaller instrument cooling fans. On one side is a bright light, and on the other a small solar cell. Light fluctuations picked up by the solar cell are then fed to the guitar amplifier. The array consists of fans with different numbers of blades. This, coupled with changing the fan speed, results in some amazing sound effects.

There’s a whole bunch more, and even though the “instructions” to replicate the instruments aren’t well documented, there’s enough for anyone who’s interested to start experimenting.

Continue reading “When Appliance Hackers Hit The Music Scene”

Naming Names

We have all heard that good variable names are important for creating readable programs — advice that will serve you well when you come back to your code two years later, or even twenty. Sometimes, when you are so deep in the zone and begin to question a variable name that you made three levels up the calling hierarchy, it can be helpful to take a step back and review your variable naming conventions. The wikipedia article on computer program naming conventions is a good starting point, where you can dig into the nitty gritty of Hungarian notation like bFlag, case separated names like camelCase, and so on. But sometimes you have to go meta, and need names to describe the names themselves.

For example, in everyday usage the terms parameter and argument are often used interchangeably. But strictly speaking, a parameter is a placeholder, the variables in a function declaration for example (see image above). An argument is the actual value itself, say the number 50.334 in the example.

We recommend that units of measure should always be clearly specified in your comments, perhaps even in the variable names if you’re mixing different systems in the same program. At Hackaday we prefer to use SI units, check out NIST SP 330 if you’re interested. But invariably, there are going to be exceptions for years to come. We like to deal with those at the edges during I/O if possible, thus keeping a consistent set of units in the core of the program.

What about the terms number and value? We like to think of a number as being a kind of value. For example, a function’s return value could be a number, say a velocity. Or it could return an enumeration or a boolean. Sometimes the perfect meta-name for something will collide with a reserved keyword in your programming language, names like string or data for example. In these cases you have to be creative and find suitable synonyms, perhaps text and payload.

Using consistent and precise language can be tedious, but it can be just as helpful as good commenting and variable naming practices. Do you have any examples where precise terminology such as this has been been helpful or perhaps tripped you up? If so, share in the comments section below.

 

 

OpenSCAD Prints Woodworking Aid

Home-based 3D printing is getting pretty unremarkable. Sure, printers aren’t as ubiquitous as, say, PCs. But you wouldn’t be any more surprised if your neighbor had a 3D printer than if you found out they had a drill press. In fact, sometimes the real value of 3D printing something isn’t to make a working part, but to make up something that helps you create other things using methods other than printing. That’s exactly what [iqless] does when he uses his printer to make some jigs to help him easily build shelves. (Video, embedded below.)

The issue is making dowel joints for the shelve’s feet. Sure, you could just drill a piece of scrap wood as a template, but with a 3D printer you can do better. Using OpenSCAD, it is possible to create a parameterized jig that fits exactly the job at hand.

Continue reading “OpenSCAD Prints Woodworking Aid”

Obstacle Climbing Rover Built With The Power Of Lego

When we want to prototype a rover, we’ve developed a tendency to immediately reach for the 3D printer and Arduino or Raspberry Pi. It’s easy to forget the prototyping tool many of us grew up using: LEGO. The [Brick Experiment Channel] has not forgotten, and in the video after the break demonstrates how he used Lego Technic components to prototype an impressive little obstacle climbing robot.

The little Lego rover starts as a simple four-wheeled rover trying to climb on top of a book. Swap in a four-wheel-drive gearbox and grippy tires, and it clears the first obstacle. Add a few books to the stack causes the break-over angle to become an issue, so the rover gets an inverted-V chassis. As the obstacle height increases, batteries are moved around for better weight distribution, but the real improvement comes when an actuating middle joint is added, turning it into a wheeled inchworm. Clearing overhangs suspended beams, and gaps are all just a matter of finding the right technique.

Thanks to Lego’s modularity, all this is possible in an hour or two where a 3D printer and CAD might have stretched it into days. This robot does have the limitation of not being able to turn. Conventional car steering or Mecanum wheels are two options, but how would you do it?

The [Brick Experiment Channel] knows a thing or two about building Lego robots, even for stealing keys. Continue reading “Obstacle Climbing Rover Built With The Power Of Lego”