Giving the Arduino deques, vectors and streams with the standard template library

The Arduino IDE is extremely similar to C++, but judging from the sketches you can find on the Internet, you’d never know it. Simpler Arduino projects can make do with just toggling IO pins, reading values, and sending serial data between two points. More complex builds fall into the category of real software development, and this is where the standard Arduino IDE falls miserably short.

[Andy] saw this lack of proper libraries for more complicated pieces of software as a terrible situation and decided to do something about it. He ported the SGI Standard Template Library to bring all those fun algorithms and data structures to any AVR chip, including the Arduino.

Going over what’s included in [Andy]‘s port reads just like a syllabus for an object-oriented programming class. Stacks, queues, and lists make the cut, as do strings and vectors. Also included is just about everything in the   and headers along with a few Arduino-oriented additions like a hardware serial and liquid crystal streams.

With all these objects floating around, [Andy] says it will make an impact on Flash and SRAM usage in an AVR. Still, with all the hullabaloo over faster and larger ARM micros, it’s nice to see the classic 8-bit microcontroller becoming a bit more refined.

Debugging the Stellaris with OpenOCD

It looks as though Texas Instruments are really reaching out to the hacker community with their new ARM-powered Stellaris dev board. On the Stellarisiti forums, a member asked about the debugging options for the Stellaris board. The Stellaris already features an In-Circuit Debug Interface (ICDI), but unfortunately it’s a little hard to get working in Linux-ey environments.

One of the devs for the Open On-Chip Debugger was already talking with TI to get the ICDI spec released for the Stellaris board. TI released the info, and after quite a bit of work, everything is open for all to see.

Right now, OpenOCD support for the Stellaris is still incomplete, but there is an project up on the Gits that allows for multi-platform development for TI’s new board.

Needless to say, getting everything up and running is still a chore. That’s not really a concern, though; the Stellaris has only been around for a few months and it takes devs time to put all the required tools into nice, neat packages. We’re just glad TI is being so forthcoming with the relevant documentation, lest development becomes a million times harder.

μJ, a Java virtual machine for microcontrollers

[Dimitri] sent in a project he’s been working on that implements a Java Virtual Machine purely in C, and is easily portable between microcontrollers such as the AVRs and PICs we normally see, ARM devices, and even the lowly 386.

Before going into the ‘how’, [Dimitri] first covers why he wanted to run Java bytecode on a microcontroller. Basically, he found existing solutions like the Arduino environment too complex for people just wanting to program a chip. Arduino and PICAXE require C-like syntax and pointers; not the easiest thing when everyone and their mother can program in Java.

As for how [Dimitri] managed to pack a JVM into a microcontroller, that’s another story entirely. Everything in the JVM, from double, long, and float data types to exceptions, neat thread-related functions such as ‘synchronize’ and even methods such as String.charAt() and String.length() are completely optional. If your microcontroller is too small, just disable the functions you don’t need.

As for how well – and how fast – μJ is able to run, [Dimitri] threw up a demo of an ATMega644 and PIC24 running his JVM and a small Java app. You can check those videos out after the break, or just download the source for μJ on [Dimitri]‘s site.

[Read more...]

Have a baby? Build another one!

Ever since his daughter was born, [Markus] has been keeping logs full of observations of human behavior. Despite how it sounds, this sort of occurrence isn’t terribly odd; the field of developmental psychology is filled with research of this sort. It’s what [Markus] is doing with this data that makes his project unique. He’s attempting to use stochastic learning to model the behavior of his daughter and put her mind in a robot. Basically, [Markus] is building a robotic version of his newborn daughter.

The basics of stochastic learning (PDF with more info) is that a control system is modeled on an existing system – in this case, a baby – by telling a robot if it is doing a good or bad job. Think of it as classical conditioning for automatons that can only respond to a 1 or 0.

[Markus] built a robotic platform based on an Arduino Mega and a few ultrasonic distance sensors. By looking at its surrounding environment, the robot makes judgments as to what it should do next. In the video after the break, [Markus] shows off his robot finding its way around an obstacle course – really just a pair of couch cushions.

It’s a long way from crawling around on all fours, paying attention to shiny things, and making a complete mess of everything, but we’re loving [Markus]‘ analytical approach to creating a rudimentary artificial intelligence.

[Read more...]

Putting guitar pedals in a web page

Only half of playing guitar – according to a few musician friends of mine – is moving your fingers up and down a fretboard and banging out some chords. The other half is the artistry of mastering your tone, usually through amp settings and stomp boxes.

Effects pedals – little boxes of electronics that go between the guitar and amp – are able to amplify and distort a guitar’s output, add reverb and delay, and even filter the tone via a wha or envelope pedal. These pedals can be simulated in software, but we can’t believe that they can now be emulated completely in JavaScript.

Pedalboard.js is a project put together by [dashersw], and aims to put a slew of pedals ‘in the cloud’ and turn editing and effects board as easy as building a web page.

The project is built around Webkit’s W3C audio API, allowing this virtual pedal board to work in Chrome, Safari, and other Webkit-enabled browsers. Pedals are programmed as nodes, each configurable to have and input, output, or analyzer that is able to modify the gain, wave shape, or filter of anything received by the line in on your computer.

Thee is a small demo of Pedalboard.js available here with a pre-recorded guitar track feeding into a few stomp boxes. It’s a pretty cool idea if you’d like to play around with a few guitar effect, but we can’t wait to see this bit of JavaScript implemented by effects pedal manufacturers allowing us to try before we buy.

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.

[Read more...]

Follow

Get every new post delivered to your Inbox.

Join 93,600 other followers