Code Craft: Using Eclipse For Arduino Development

As we work on projects we’re frequently upgrading our tools. That basic soldering iron gives way to one with temperature control. The introductory 3D printer yields to one faster and more capable. One reason for this is we don’t really understand the restrictions of the introductory level tools. Sometimes we realize this directly when the tool fails in a task. Other times we see another hacker using a better tool and realize we must have one!.

The same occurs with software tools. The Arduino IDE is a nice tool for starting out. It is easy to use which is great if you have never previously written software. The libraries and the way it ties nicely into the hardware ecosystem is a boon.

When you start on larger projects, say you upgrade to a Due or Teensy for more code or memory space, the Arduino IDE can hamper your productivity. Moving beyond these limitations requires a new, better tool.

Where do we find a better tool? To begin, recognize, as [Elliot] points out that There is no Arduino “Language”, we’re actually programming in C or C++. We chose which language through the extension on the file, ‘c’ for C and ‘cpp’ for C++. An Arduino support library may be written in C or C++ depending on the developer’s preference. It’s all mix ‘n match.

Potentially any environment that supports C/C++ can replace the Arduino IDE. Unfortunately, this is not easy to do, at least for inexperienced developers, because it means setting up the language tool chain and tools for uploading to the board. A developer with that much experience might eschew an integrated development environment altogether, going directly to using makefiles as [Joshua] describes in Arduino Development; There’s a Makefile for That.

The reality is the Arduino IDE is not much more than a text editor with the ability to invoke the tools needed to compile and download the code to the Arduino. A professional IDE not only handles those details but provides additional capabilities that make the software development process easier.

Continue reading “Code Craft: Using Eclipse For Arduino Development”

Embed With Elliot: Going ‘Round With Circular Buffers

Why Buffer? Because buffers cut you some slack.

Inevitably, in our recent series on microcontroller interrupts, the question of how to deal with actual serial data came up. In those examples, we were passing one byte at a time between the interrupt service routine (ISR) and the main body of code. That works great as long as the main routine can handle the incoming data in time but, as many people noted in the comments, if the main routine takes too long the single byte can get overwritten by a new one.

The solution? Make some storage room for multiple bytes so that they can stack up until you have time to process them. And if you couple this storage space with some simple rules for reading and writing, you’ve got yourself a buffer.

So read on to see how to implement a simple, straightforward circular buffer in C for microcontrollers (or heck, for anything). Buffers are such a handy tool to have in your programming toolkit that you owe it to yourself to get familiar with them if you’re not already.

Continue reading “Embed With Elliot: Going ‘Round With Circular Buffers”

2015 Hackaday Prize Presentation Draws Near

The judges of the 2015 Hackaday Prize are hard at work right now to choose the five finalists who will receive the top prizes for the 2015 Hackaday Prize. The Judges for the Best Product have finished their work, and the announcements for all of these amazing engineering projects is just around the corner. We’ll be making the announcement in front of a live audience at the Hackaday SuperConference in just two weeks!

It has been amazing to see hundreds of people from the Hackaday Community who took time out of their lives to build something that matters and to document it as their entry. This has far-reaching benefits that will echo for years to come. No matter where your project finishes, standing up and saying “here’s something I built from an idea I had” is an amazing thing. Great work!

We are profoundly thankful for the visionary companies that sponsored the 2015 Hackaday Prize. Atmel, Freescale, Microchip, Mouser, and Texas Instruments made so much of this year’s prize possible. They recognize what it means to use Open Design; a philosophy that lets talented people pass on their skills by their engineering examples.

A big part of their support this year has gone to hosting live events. Hackaday Prize Worldwide was held in Chicago, Mumbai, Toronto, New York, Bangalore, Los Angeles, San Francisco, Shenzhen, New Delhi, Boston, Washington DC, Zurich, and Berlin. Their involvement continues with the presentation planned on Saturday November 14th at the Hackaday SuperConference.

Mouser Electronics has partnered with Grant Imahara of MythBusters fame. Grant is a talented roboticist who will have a talk and Q&A session at the SuperCon about his career. Microchip is giving away [Lucio Di Jasio’s] new book on microcontrollers to conference attendees. Atmel leapt at the opportunity to send development hardware for [Colin O’Flynn’s] workshop (he took Second Place in the 2014 Hackaday Prize), helping to lower the workshop cost for the participants.

Of course, it’s not just the events that were possible due to these sponsorship. Along with Supplyframe who presents the Hackaday Prize each year, these sponsors made the total prize package of about $500,000 a reality. It’s not everyday you can give away a trip into space as a Grand Prize and $100,000 for the Best Product. This is an amazing way to support the hardware ideals we live by and we applaud our sponsors for their meaningful involvement.

The 2015 Hackaday Prize is sponsored by:

Hacking When It Counts: Surviving The Burma Death Railway

In the early days of World War II, the Japanese army invaded Burma (now Myanmar) and forced an end to British colonial rule there. Occupying Burma required troops and massive amounts of materiel, though, and the Japanese navy was taking a beating on the 2,000 mile sea route around the Malay Peninsula. And so it was decided that a railway connecting Thailand and Burma would be constructed through dense tropical jungle over hilly terrain with hundreds of rivers, including the Kwae Noi River, made famous by the Hollywood treatment of the story in The Bridge on the River Kwai. The real story of what came to be known as the Burma Death Railway is far grislier than any movie could make it, and the ways that the prisoners who built it managed to stay alive is a fascinating case study in making do with what you’ve got and finding solutions that save lives.

Nutrition from Next-to Nothing

AWM_P00761_011-540
POWs in camp. [Source: The Thai-Burma Railway and Hellfire Pass]
Labor for the massive project was to come from the ultimate spoil of war – slaves. About 250,000 to 300,000 slaves were used to build the Burma-Siam Railway. Among them were about 60,000 Allied prisoners of war, primarily Australian, Dutch, British and American. POWs were singled out for especially brutal treatment by the Japanese and Korean guards, with punishment meted out with rifle butt and bamboo pole.

With the POWs was Doctor Henri Hekking, who had been born and raised in the former Dutch East Indies colony of Java (now Indonesia). He had spent his early years with his grandmother, a master herbalist who served as “doctor” for the native villagers. Inspired by his oma’s skill and convinced that the cure for any endemic disease can be found in the plants in the area, Dr. Hekking returned to Java as an officer in the Dutch army after completing medical school in the Netherlands.

After his capture by the Japanese, Dr. Hekking did everything he could to help his fellow POWs despite the complete lack of medical supplies, all the while suffering from the same miserable treatment. Hekking realized early on that the starvation rations the POWs endured were the main cause of disease in the camps; a cup of boiled white rice doesn’t provide much energy for men building a railway by hand in jungle heat, and provides none of the B vitamins needed by the body.

Continue reading “Hacking When It Counts: Surviving The Burma Death Railway”

Developed On Hackaday – It’s A Badge. No, It’s The HaDge

Sometime back, we announced start of a new project under the “Developed on Hackaday” series – a Badge for the Hackaday community. At its core, this badge is a single node in an Internet of Badges. At every event this badge is deployed at, a Hackaday Sub-Etha mesh network will be created, and each badge will be able to transmit and receive messages from other badge wearers. There are plans for an Sub-Etha to Internet gateway, so even if badge wearers are on the other side of the world, they’re still connected through the HaDge network.

Things have been moving along quickly, so I thought of doing a quick round-up and share progress with the community. First off, it has a name. HaDge, as in HackaDay Badge. Our objectives up until now were to set up a team, name the project, set up repositories and lock down on a working bill of materials. Within a few weeks, we’ve got all of that tied down. The HaDge group chat channel has been super active, and everyone’s been pitching in with ideas and suggestions. A spreadsheet seemed like a good idea – it let everyone add in their suggestions regarding candidate parts, create a feature list and then talk about it on the channel.

We realized early on that building the hardware is going to take some time. So in the interim, we need a dev kit platform to get in to the hands of the software developers so they can start working on the smarts that will power the HaDge. [Michele Perla] had already built JACK (Just another Cortex kit) – a development kit powered by the Atmel SAM D21. It’s pretty bare bone with just the bare minimum of parts to make it work while keeping an eye on reliability. The microcontroller+radio on the HaDge is the Atmel SAM R21 – a close relative of the D21, so it made sense to respin the JACK and create HACK (Hackaday Cortex kit) – a development kit powered by the Atmel SAM R21 that is going to be used as the core of the HaDge. [Michele] has worked hard single-handedly to complete the design and it is now ready to go for PCB fabrication soon. We are just awaiting some feedback and review of the Antenna part of the design. None of us on the hardware team have a strong RF-fu so we don’t want to make an avoidable mistake. If you’d like to review and help vet the HACK design, grab the design files from the github repo and let us know.

Once HACK board layout is cleared for fabrication, we’ll work on building kits that can be sent out to the software folks. We will also be working on porting the HACK design in to KiCad and this is something I have already stared work on. I started by using the neat Eagle2KiCad conversion tool by [LachlanA]. It’s not perfect, but it does reduce the work involved in porting over from Eagle to Kicad. Once that is done, hardware development for the actual HaDge will see some progress – keep a watch on the project page.

Hackaday Links: October 25, 2015

There are dozens of different 3D printable cases out there for the Raspberry Pi, but the BeagleBone Black, as useful as it is, doesn’t have as many options. The folks at 3D hubs thought they could solve this with a portable electronics lab for the BBB. It opens like a book, fits a half-size breadboard inside, and looks very cool.

The guy who 3D printed his lawnmower has a very, very large 3D printer. He now added a hammock to it, just so he could hang out during the very long prints.

There’s a box somewhere in your attic, basement, or garage filled with IDE cables. Wouldn’t they be useful for projects? Yep, only not all the wires work; some are grounds tied together, some are not wired straight through, and some are missing. [esot.eric] has the definitive guide for 80-wire IDE cables.

Like case mods? Here’s a golden apple, made out of walnut. Yes, there are better woods he could have used. It’s a wooden replica of a Mac 128 with a Mac Mini and LCD stuffed inside. Want a video? Here you go.

If you have a 3D printer, you’re probably familiar with PEEK. It’s the plastic used as a thermal break in non-all-metal hotends. Now it’s a filament. An extraordinarily expensive filament at €900 per kilogram. Printing temperature is 370°C, so you’ll need an all-metal hotend.

It’s the Kickstarter that just keeps going and going and going. That’s not a bad thing, though: there really isn’t much of a market for new Amiga 1200 cases. We’ve featured this project before, but the last time was unsuccessful. Now, with seven days left and just over $14k to go, it might make it this time.

Hacklet 81 – Tracked Projects

Sometimes wheels just don’t cut it. When the going gets tough, the tough make tracks. Continuous track drive systems – aka tank treads, or tracks, have been around for centuries. The first known use in relatively modern history is a system designed in 1770’s by [Richard Lovell Edgeworth]. Since then there has been a slew of engineers, hackers, and makers who have contributed to this versatile drive system. Today, tread systems find their way into plenty of robotics and transportation projects. This week’s Hacklet is all about some of the best track drive projects on Hackaday.io!

track1We start with [jupdyke] and Modular Continuous Track System. [Jupdyke] has made a project out of making the tracks themselves. These tracks are strong – shore 70A urethane rubber is no joke! Quite a bit of research and experimentation has gone into this project. [Jupdyke] started with 3D printed parts, before moving on to molded 2 part rubber. The rubber is cast in custom machined aluminum molds. The molds are even heated to ensure a quality casting. Rubber alone doesn’t make a track though. The backbone of these tracks are machined steel pins. The pins go through the treads and connect through roller chain components. We’re betting a set of these tracks could easily carry a person!

robot-tankNext up is [williamg42] with Expandable Ruggedized Robotic Platform. [Williamg42] describes this vehicle as “able to operate in harsh environments”. We would shorten that to “It’s a beast”. Some incredible machine work has gone into this robot, especially on the suspension and idler wheels. Everything is made of metal – the frame is 8020 aluminum extrusion covered in plates. The suspension is aluminum and steel. Motors are mini-CIM motors. This robot isn’t lacking on brains, as a BeagleBone black controls it through a custom cape board. Next time we go out on a desert trek, we want this ‘bot at our side!

ttbn-alphaFrom the mind of [TinHead] comes TTBN Alpha, a TelePresence robot. TTBN alpha is based on a Raspberry Pi. Rather than start with Raspbian, [TinHead] built his own lightweight Linux distribution with buildroot. Control is through a web interface. The operator’s view of the world is through the electronic eye of a Logitech C110 webcam. [TinHead] printed his own tracks, using straightened paperclips as pins. Two servos modified for continuous rotation serve as the main drive motors.

 

surocam

Finally we have [Hendra Kusumah] with Surveillance Robot Camera (SUROCAM). SUROCAM was [Hendra’s] project for both the 2014 and 2015 Hackaday Prize. The chassis is based upon the common RP5 robot kit. This robot’s DC motors are driven by the classic L298n driver chip. Unlike TTBN Alpha above, SUROCAM uses a full Raspbian install, so this Pi is ready for anything. The code is written in Python, and pagekite and ngrok to help make connections to the outside world.

If you want to see more tank treaded rovers, check out our new tracked projects list. Did I miss your project? 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!