There are many projects that call out for a custom language parser. If you need something standard, you can probably lift the code from someplace on the Internet. If you need something custom, you might consider reading [Federico Tomassetti’s] tutorial on using ANTLR to build a complete parser-based system. [Frederico] also expanded on this material for his book, but there’s still plenty to pick up from the eight blog posts.
His language, Sandy, is complex enough to be a good example, but not too complex to understand. In addition to the posts, you can find the code on GitHub.
Continue reading “Language Parsing With ANTLR”
Java Grinder is a tool that compiles Java programs to run on platforms like microcontrollers and consoles, by outputting native assembly code and using APIs to work with custom hardware like bespoke graphics and sound chips. Amongst other hardware, Java Grinder supports the Commodore 64, which uses a variant of the 6502 CPU. [Michael Kohn] realized the Atari 2600 shares this processor, and figured he’d get started on making Java Grinder work with the Atari by expanding on the C64 work done by [Joe Davisson]. Together, they brought Java to the Atari 2600 and made a game along the way.
According to [Michael], parts of the project were easy, as some Java routines compile down into as little as 1 or 2 instructions on the 6502. Other parts were harder, like dealing with the graphics subsystem, and modifying Java Grinder to output 8-bit bytecode to fit into the Atari’s tiny 4K ROM limit. Even with this tweak, they still couldn’t fit in a game and title screen. In the end they relied on bank switching to get the job done. [Joe]’s game is pretty solid fare for the Atari 2600 — blocky graphics and bleepy sounds — and they’ve uploaded it to the page so you can try it yourself in an emulator.
At the end of the day, porting Java code to a system with 128 bytes of RAM probably isn’t going to be particularly useful. However, as a coding exercise and learning experience, there’s a lot of value here in terms of building your skills as a coder. Other such experiments have shown us Java running on other unexpected devices, like the Sega Genesis or the MSP430. Video after the break.
Continue reading “Atari Now Runs Java, Thankfully Doesn’t Require Constant Updates”
So, wether you’ve blown your house’s breakers while cranking up the power on your latest project or a storm has brought low the local power grid, what do you do if you desperately need coffee with no electricity to power your coffee maker? Make like [austiwawa]: crack it open and bust out the tea lights.
Removing the bottom of the coffee maker is simply done, exposing the resistance heating element. Improvising a jig to hold the coffee maker over an arrangement of five tea lights, the candle flames slowly do the work of heating the element to set the maker in motion.
It’s a solution for after the apocalypse… as long as you can find tea lights, coffee plus a grinder, and for some reason don’t want to use the quick and efficient method of brewing over an actual fire (though kitchen hearths are a rarity these days). Now we kind of want to see this adapted for all kinds of other heat sources. Reflected sunlight anyone?
Continue reading “Brew A Cup Of Coffee Without Electricity!”
[mfaust] wakes up in the morning like a regular person, goes to work like a regular person, types in tedious commands for his software versioning utilities like a regular person, and then, as a reward, gets his coffee, just like rest of us. However, what if there was a way to shorten the steps, bringing us all closer to the wonderful coffee step, without all those inconvenient delays? Well, global industry is trying its best to blot out the sun, so mornings are covered there. [Elon Musk’s] thinktank proposed the hyperloop, which should help with the second step. [mfaust] built a control station for his versioning software. Raise your cup of joe high for this man’s innovative spirit.
He first laid out all the buttons, LED lights, and knobs he’d like on a panel to automate away his daily tasks. Using photoshop he ended up with a nice template. He laminated it to the top of a regular project box and did his best to drill holes in the right places without a workshop at his command. It’s pretty good looking!
Since this is the sort of thing an Arduino is best at he, in a mere two tries, wired everything up in such a way that it would all cram into the box. With everything blinking satisfactorily and all the buttons showing up on the serial out, he was ready for the final step.
Being a proficient and prolific enough developer to need a control panel in the first place, like a sort of software DJ, he wrote a nice interface for it all. The Arduino sits and waits for serial input while occasionally spitting out a packet of data describing its switch status. A Java daemon runs in the background of his computer. When the right bits are witnessed, a very nicely executed on screen display reports on the progress of his various scripts.
Now he can arrive at the hyperloop terminal during the appropriate work time slot in Earth’s perpetual night. After which he simply walks up to his computer, flips a few switches, glances quickly at the display for verification, and goes to drink some nice, hydroponically grown, coffee. Just like the rest of us.
Hackers need fuel to hack. In general that fuel comes in the form of food, water, and caffeine. Not necessarily in that order. While soda or energy drinks will do in a pinch, the best hackers know that the purest form of caffeine comes from coffee. This of course means that there have been decades of coffee hacks. The first Internet-connected coffee pot dates all way back to 1991, before the web even had pictures. We’ve come a long way since then. This week on the Hacklet we’re checking out some of the best coffee hacks on Hackaday.io!
We start with [opeRaptor] and CoffeeOfThings. [OpeRaptor] has created a wireless, internet connected coffee carafe. The carafe has three CdS cells which enable it to detect how much black gold is left in the pot. A TMP36 sensor reports the current coffee temperature. Data is sent out via a NRF24l01 radio. The brains of the coffee pot is an MSP430 microcontroller. All this runs from a simple CR2032 coin cell. A base station receives the coffee data, displays it on a very nice Vacuum fluorescent Display (VFD). An ESP8266 then passes the data on to the internet.
Next up is [magnustron] with quad-386 coffee heater. No one likes a cold cup of coffee. Everyone loves old CPUs. [Magnustron] turned these two shower thoughts into a the world’s first USB powered quad CPU coffee warmer with data logging capabilities. A simple ATtiny461 micro runs the show. PC connectivity is via USB using the V-USB library. [Magnustron] has gotten the CPUs to warm up, but is having some issues with switching. them on. Turning all four heaters on too quickly causes the rail to droop, leading to dropped USB connections. Those power-hungry 386 chips may be a bit too much for a single USB connection. It might be time to add an external power supply.
Next is [kesh1030] with Using Waste Coffee As A Biodiesel Source. Coffee isn’t just liquid energy. There’s oil in them there grounds. Millions of pounds of used coffee grounds produced every year can be converted to biodiesel fuel. [Kesh1030] experimented with different coffee grounds, and different ways to prepare them. The oil was extracted from the coffee using hexane, which is a bit of a nasty solvent. [Kesh1030] used a fume hood to stay safe. He found that homogenized coffee grounds had an 11.87% oil yield. Used homogenized coffee grounds weren’t far behind, with 9.82% yield of oil. Nearly 10% per weight yield isn’t too shabby, considering this is all going into the trash.
Finally, we have [saadcaffeine] with Caffeinator: gravity powered geek fuel dripper. This is a project of few words, but the images tell much of the story. [Saadcaffeine] created his own cold drip iced coffee maker using upcycled and found components. Three clothes hangers form an ingenious tripod. The tripod holds two soda bottles – the water reservoir and the brew pot. Water is restricted by small holes in the soda bottle caps. This allows it to drop slowly though the machine, giving it time to soak up all the caffeinated goodness. The result is a fresh cup of cold drip. Just add ice and enjoy a quick power up!
If you want to see more coffee hacks, check out our new coffee projects list. See a project I might have missed? Don’t be shy, just drop me a message on Hackaday.io. That’s it for this week’s Hacklet, As always, see you next week. Same hack time, same hack channel, bringing you the best of Hackaday.io!
We’ve never seen someone build a plotter out of buzzwords, but [roxen] did a really good job of it. The idea is simple, place the plotter over a sheet of paper, open a website, draw, and watch the plotter go. Check out the video below the break.
The user draws in an HTML5 Canvas object which is read by a Java Web Server. From there it gets converted to serial commands for an Arduino which controls the steppers with two EasyDrivers.
The build itself is really nice. It perfectly meets the mechanical requirements of a pen plotter without a lot of fluff. The overall frame is T-shaped, for the x- and y-axis. The movements are produced by two steppers and acetal rack and pinion sets. The pen is lifted up and down by a hobby servo.
Continue reading “Arduino Makerbeam Live Plotter Controlled By HTML5 Canvas And Java Website”
A few years ago, [Mike]’s friend gave him an old Sega Genesis with the very cool and somewhat rare SegaCD drive attached. The SegaCD gave him an idea – while it’s not easy to burn a cartridge and play homebrew games on a real Genesis console, everyone has a CD burner somewhere. [Mike] began writing his demo and then realized adding Java would be easy on the 68000. The result is Java on three billion devices and a Sega Genesis.
This project is built around Java Grinder a Java byte code compiler that will compile classes, factories, and all the horrible Java design.design.pattern.pattern.patterns() into assembly language. Already, there are a lot of platforms supported by Java Grinder, including the Commodore 64, the TI99, and thanks to some work from [Joe Davisson], the Apple IIgs
With a byte code compiler, an assembler, and an API for the Sega-specific hardware, [Mike] set about building his demo. Since this was a Sega, it needed the ‘SEGA’ sound at the start. [Mike] ended up recording his voice saying ‘JAVA!’ This plays through the Z80 on the Genesis.
The complete demo – viewable in its emulated format below – has everything you would expect from a proper demo. Starfields, dancing sprites, and even a Mandelbrot pattern make it into the three-minute long demo.
Continue reading “3 Billion Devices And A Sega Genesis Run Java”