Bringing Java To The World Of Microcontrollers

C is a beautiful language perfectly suited for development on low-power devices such as the 8-bit microcontrollers. With newer, more powerful ARM microcontrollers making their way onto the market and workbenches around the world, it was only fitting that Oracle got in on the action. They released a version of Java targeted at these newer, more powerful microcontrollers called Java ME embedded.

The new embedded version of Java has everything you would expect from a microcontroller development platform – access to GPIO pins, including SD cards and I2C devices. The new Java machine is designed for full headless operation and is capable of running on devices with as little as 130 kB of RAM and 350 kB of ROM.

As for the utility of programming a microcontroller in Java, it’s still the second most popular language, after spending the better part of a decade as the number one language programmers choose to use. The requirements of the new embedded version of Java are far too large to fit onto even the best 8-bit microcontrollers, but with a new crop of more powerful ARM devices, we’ll expect to see more and more ARM/Java projects making their way into the Hackaday tip line in the coming months.

Tip ‘o the hat to [roger] for sending this one in.

Web IDE For The Raspi

For this month’s release of Adafruit’s Raspberry Pi Linux distribution, [Limor], et al. decided to build a web-based IDE for the Raspberry Pi.

The Raspberry Pi WebIDE is a web server that runs on the Raspi. By connecting to your raspi in a web browser, you’re able to create your own Python programs that are able to interact with the GPIO pins. All the code is stored in the cloud with the help of bitbucket.

The WebIDE is in its early Alpha stage right now; there are a few bugs and minor issues, but in the video after the break, [Limor] shows us it’s possible to push code to a Raspi through the Internet and view the result in a web-based serial terminal.

For fear of editorializing, we have to point out that Adafruit’s web IDE – along with other Arduino web IDEs such as Codebender and the Wifino – work on the cloud. If you’re planning a long-term project that relies on a web-based IDE, you might be in for a world of hurt if only because you can’t host a cloud on a personal server. We’d love to see a package that allows us to have the same functionality as bitbucket on a personal server. If you can find a project that does something similar, or have written your own, send it in and we’ll spread the word.

Continue reading “Web IDE For The Raspi”

A JavaScript Interpreter For ARM ‘micros

When programming a microcontroller to do your bidding, you only have two choices. You could write your code in a proper language such as C and cross-compile your source into a piece of firmware easily understood by a micro. Alternatively, your could load an interpreter on your microcontroller and write code via a serial connection. Interpreters are a really fast and easy method to dig in to the hardware but unfortunately most microcontroller interpreters available are based on BASIC or Forth.

[Gordon] figured it’s not 1980 anymore, and interpreters for these relatively low-level languages aren’t a good fit with the microcontrollers of today. To solve this problem, he created Espruino, a JavaScript interpreter for the new batch of ARM development boards that have been cropping up.

Espruino is designed for the STM32VL Discovery board, although [Gordon] plans on porting his interpreter to the Arduino Due when he can get his hands on one. Installation is as easy as uploading any other piece of firmware, and even though [Gordon]’s STM32VL doesn’t have a USB port for a serial terminal, it’s a snap to connect a USB to TTL converter and get this interpreter working.

Espruino isn’t open source yet, only because [Gordon] would like to clean up his code and write a bit of documentation. He’d also like to make Espruino profitable so he can work on it full-time, so if anyone has an idea on how [Gordon] can do that, leave a note in the comments.

3D Games For The Arduino With Raycasting

For all the Arduino-based video game builds we’ve seen, we’re really only left with a bunch of 2D platformers and other sprite-based games. [Reimecker] wasn’t satisfied with this level of computational complexity, so he ported the 3D game engine made famous by Duke Nukem 3D to the Arduino (German, Google translation).

[Reimecker]’s project is based on the very popular Build Engine written by [Ken Silverman] and used in games such as Duke Nukem 3D,  Shadow Warrior,  Blood, and TekWar. The Build Engine can be used to make a first person shooter, but more on the level of Wolfenstein 3D instead of Half-Life.

The hardware [Reimecker] used is a regular ‘ol 8-bit Arduino with an attached LCD touch screen displaying 320×240 pixels of a ray cast environment. From the videos of the build (available after the break), [Reimecker] has a fairly decent game engine capable of displaying a 2.5D environment. The frame rate might not be very high, but it’s still an amazing build considering the hardware [Reimecker] is working with.

Continue reading “3D Games For The Arduino With Raycasting”

Visualizing Water Droplets And Building A CT Scanner

Since his nerves were wracked by presenting his project to an absurdly large crowd at this year’s SIGGRAPH, [James] is finally ready to share his method of mixing fluids via optical tomography with a much larger audience: the readership of Hackaday.

[James]’ project focuses on the problem of modeling mixing liquids from a multi-camera setup. The hardware is fairly basic, just 16 consumer-level video cameras arranged in a semicircle around a glass beaker full of water.

When [James] injects a little dye into the water, the diffusing cloud is captured by a handful of Sony camcorders. The images from these camcorders are sent through an algorithm that selects one point in the cloud and performs a random walk to find every other point in the cloud of liquid dye.

The result of all this computation is a literal volumetric cloud, allowing [James] to render, slice, and cut the cloud of dye any way he chooses. You can see the videos produced from this very cool build after the break.

Continue reading “Visualizing Water Droplets And Building A CT Scanner”

Rendering OpenSCAD In The Browser

If you haven’t heard of it, OpenSCAD is a really wonderful tool for 3D modeling.  While it doesn’t have the traditional graphical interface of AutoCAD – it’s basically a programming language for 3D models – OpenSCAD is able to create very complex parts with only a few lines of code.

That’s all well and good, but what if you wanted to edit OpenSCAD parts in your browser? Enter OpenJsCAD, an OpenSCAD interpreter written entirely in Javascript and able to be embedded in a web page.

OpenSCAD allows for two types of modeling – constructive solid geometry, or taking 3D primitives and stretching, scaling, and intersecting them to create a 3D shape, or extrusion from a 2D outline. Quite a few RepRap parts were designed in OpenSCAD, and the lightweight interface and open source nature means it’s perfect for designing stuff to print on your Makerbot.

Tip ‘o the hat to [Gordon] for sending this one in, and we really have to commend him for writing his own online scriptable CAD exporter before finding out about OpenJsCAD. He may be a little late to the online OpenSCAD party, but we have to agree with him that an online 3D solid editor would be an awesome feature for Thingiverse to roll out.

Writing Javascript Without Using Any Letters Or Numbers

Did you know it’s possible to write Javascript code without using any letters or numbers at all? Well, it’s not just Javascript, but that’s the language used in this demonstration. [Patricio Palladino] shows how code can be written using just eight characters, and all of them are punctuation marks.

Typecasting is the name of the game here. By starting out with an empty array formed by a pair of square brackets, [Patricio] can generate the number zero by casting the array with the plus sign. From there he can use an exclamation point (a boolean cast) and addition to generate any number. The image above is an example of the digits 0-9. This would get very tedious for larger numbers but there’s another shortcut. Cast the digits to strings, concatenate them, then cast back to a number and you’re in business.

The technique is fascinating, and basically unreadable. As a proof of concept he wrote a parser that will convert any Javascript into this hieroglyphy. Check out his Github repository to give it a try.

[via Reddit]