Arduino Brings USB Mouse To Homebrew Computer

When building your own homebrew computer, everything is a challenge. Ultimately, that’s kind of the point. If you didn’t want to really get your hands dirty with the nuts and bolts of the thing, you wouldn’t have built it in the first place. For example, take the lengths to which [rehsd] was willing to go in order to support standard USB mice on their 6502 machine.

Code for mapping mouse movement to digital output.

The idea early on was to leverage existing Arduino libraries to connect with a standard USB mouse, specifically, the hardware would take the form of an Arduino Mega 2560 with a USB Host Shield. There was plenty of code and examples that showed how you could read the mouse position and clicks from the Arduino, but [rehsd] still had to figure out a way to get that information into the 6502.

In the end, [rehsd] connected one of the digital pins from the Arduino to an interrupt pin on the computer’s W65C22 versatile interface adapter (VIA). Then eleven more digital pins were connected to the computer, each one representing a state for the mouse and buttons, such as MOUSE_CLICK_RIGHT and MOUSE_LEFT_DOWN.

Admittedly, [rehsd] says the mouse action is far from perfect. But as you can see in the video after the break, it’s at least functional. While the code could likely be tightened up, there’s obviously some improvements to be made in terms of the electrical interface. The use of shift registers could reduce the number of wires between the Arduino and VIA, which would be a start. It’s also possible a chip like the CH375 could be used, taking the microcontroller out of the equation entirely.

From classic breadboard builds to some impressively practical portable machines, we’ve seen our fair share of 6502 computers over the years. Despite the incredible variation to be found in these homebrew systems, one thing is always the same: they’re built by some of the most passionate folks out there.

Continue reading “Arduino Brings USB Mouse To Homebrew Computer”

Electric Vehicles, The Gasoline Problem, And Synthetic Fuels

When you’re standing at the gas station filling up your car, watching those digits on the pump flip by can be a sobering experience. Fuel prices, especially the price of gasoline, have always been keenly watched, so it’s hard to imagine a time when gasoline was a low-value waste product. But kerosene, sold mainly for lighting, was once king of the petroleum industry, at least before the automobile came along, to the extent that the gasoline produced while refining kerosene was simply dumped into streams to get rid of it.

The modern mind perhaps shudders at the thought of an environmental crime of that magnitude, and we can’t imagine how anyone would think that was a good solution to the problem. And yet we now face much the same problem, as the increasing electrification of the world’s fleet of motor vehicles pushes down gasoline demand. To understand why this is a problem, we’ll start off by taking a look at how crude oil is formed, and how decreasing demand for gasoline may actually cause problems that we should think about before we get too far down the road.

Continue reading “Electric Vehicles, The Gasoline Problem, And Synthetic Fuels”

The Doom computer game rendered with HTML checkboxes

Play DOOM Using Web Browser Checkboxes (Finally)

If you’ve ever felt the need to render DOOM using nothing but web browser checkboxes, [Andrew Healey] has you covered with his recent port of the first-person shooter. Naturally, this gets our tick of approval.

Yes, you read that right. You can now play DOOM in a 160 x 100 grid of HTML-generated checkboxes, much like this: ☑. The secret sauce for this project is partly derived from the fascinating Checkboxland project by fellow hacker Brian Braun, who uses HTML checkboxes to generate a variety of artistic demos.

[Andrew Healey] also made use of Cornelius Diekmann’s port of DOOM using WebAssembly, which we recently covered here on Hackaday. A smattering of code ties both projects together, and the end result is DOOM at 160×100 resolution, rendered entirely with HTML checkboxes.

The port can be played here using Chrome or Edge (other browsers may have issues if they do not support the zoom property in CSS). The source code is also available over on GitHub.

While the resolution and color palette aren’t what we have come to expect from DOOM, it’s likely that the graphics could be further improved by tinkering with the dithering and threshold settings. Higher resolutions may also be possible with further optimization.

We would be hard pressed to pick our favorite port of DOOM, as the list is becoming quite long. However for something completely different, check out our story on how DOOM was brought to Twitter.

Continue reading “Play DOOM Using Web Browser Checkboxes (Finally)”

caliper jaw tools

Printable Caliper Jaws Increase Precision, Deflect Derision

If you’ve watched as many machining videos as we have, no doubt you’ve seen someone commit the cardinal sin of metalworking: using caliper jaws to scratch a mark into metal. Even if it’s a cheap Harbor Freight caliper rather than an expensive Starrett or Mitutoyo tool being abused, derision and scorn predictably rain down upon the hapless sinner’s head.

The criticism is not without its merit, of course. Recognizing this, [Nelson Stoldt] came up with these clamp-on nosepieces designed to turn calipers into a better marking tool. Using stock calipers as marking gauges always introduces some error, since the jaws are equal lengths and thus have to be held at a slight angle to the workpiece in order to make a mark. The caliper jaws correct for this admittedly negligible error by extending one jaw, allowing it to ride on a reference face while the other jaw remains perpendicular to the workpiece. As a bonus, the short jaw has a slot to mount a steel marking knife, saving the caliper jaws from damage.

[Nelson] chose to 3D-print his caliper jaws, but they could just as easily be milled from solid stock to make them a little more durable. Then again, you could always 3D-print the calipers in the first place, and integrate these jaws right into them.