Asynchronous Serial Communication

In a previous post, How To Integrate Arduino With Unity, we have shown how data can be sent and received through the serial port. The main problem encountered was dealing with the latency and the delays that communicating across different devices introduces. The solution proposed in that tutorial used a coroutine; decoupling the device communication from the game logic attenuates the problem, but it doesn’t remove it. The main problem is that, despite the name, Unity coroutines are not really executed in parallel with the rest of the game. Unity, by design, is not thread safe. This means that true parallelism is intentionally avoided by the engine, as it could result in race conditions. To solve the problem of the communication between Unity and Arduino, once and for all, we need actual threads.

At the end of this tutorial, you can find a link to download the Unity package.

Continue reading

How To Destroy an Arduino Board

Developers that are approaching electronics for the very first time have a lesson to learn; and this usually happens the hard way. Wiring a circuit incorrectly, and you can potentially destroy your Arduino board. When it comes to mistakes, hardware is generally not as forgiving as software. This tutorial shows the most common ways you can accidentally destroy an Arduino board; and how to avoid it.

Continue reading

How to Build a Heater with Arduino – Part 2

This is the second part of a tutorial that will teach you how to build a portable heating device with Arduino. In this post, we will explore how to control a heating resistor with Arduino. This allows to keep your setup at the desired temperature.

Continue reading

How to Build a Heater with Arduino – Part 1

This tutorial will explain how to build a portable heating device with Arduino. If you’re an amateur astronomer, this can be the perfect way to prevent the formation of dew on your mirrors and lenses. In my specific case, I’ve built one of those mini heaters to warm up a formicarium. Whether it’s for your feet or for your cold-blooded pets, building a heater is easy and cheap.

The second part of this tutorial (How to Build a Heater with Arduino – Part 2) will explain how to use a temperature sensor to maintain a desired temperature. Continue reading

How to integrate Arduino with Unity

In this tutorial you will learn how Unity and Arduino can communicate using the serial port. This tutorial requires both C# and Arduino scripts; the labels  Unity  and  Arduino  will be used to avoid confusion.

The topic of connecting Arduino to Unity is further expanded in Asynchronous Serial Communication, where you can also download the entire Unity package.

Continue reading

How to build a distance sensor with Arduino

You can safely say that when it comes to electronics, there are countless ways to measure distances. This tutorial will explain how to build an inexpensive IR distance sensor under $8, perfect for close measurements  and motion detectors.

You will need:

You can download the final Arduino code here.

altctrlThis post is part of a longer series of tutorial about alternative games controllers.

If you are going to create an alternative game controller yourself, you should definitely look into ALT.CTRL.GDC. It’s one of the most fresh and intriguing exhibitions at GDC, and is all dedicated to innovative ways to interact with games.

Continue reading

A Bestiary of Alternative Game Controllers

Many game developers are suspicious about alternative controllers, believing that since they can’t be easily mass produced, they are useless. Well, this is the story of how an Arduino got me to San Francisco for free. Twice.

alt1 Continue reading

Everything You Need to Know About LEDs

Many game developers are easily scared by electronics. Even if Arduino has shifted most of the workload on its software side, there are applications which still need a good knowledge of circuitry.  This post will teach how to use LEDs, from the most basic model to the most advanced one:

LEDs are perfect for creative projects, and they can be also be used to create entire games, such as the mesmerising Line Wobbler.

This post belongs to a series of tutorials aiming to teach game developers how to build their own alternative game controllers:

Continue reading

How to hack any IR remote controller

If you haven’t heard of Air Swimmers before, you probably had a miserable life. Air Swimmers are inflatable foil balloons made in the shape of fish. But what makes them really awesome is the fact that they can be remotely controlled to fly around in a room. One of my friends, Claudio, developed an obsession interest for them; and that’s when we decided to create our own hackuarium.

The idea was simple: buying a bunch of Air Swimmers, hacking into their controllers and running a swarm simulation to control them. If you’re interested in doing the same and you have a basic knowledge of electronics …you’re reading the right post. At the end of this article you can find the links to buy all the necessary components.

Continue reading