Introducing ORC-KIT!

Earlier this year I embarked on the journey of designing a simple but expandable robot that any electronics enthusiast could build. I knew several nice kits from brands like LegoMakeblock, OWI Robotics, etc, but I considered them to be normally either too expensive or too simple and limited. There are also many generic unbranded kits on eBay which suspiciously have all pretty much the same design but vary mostly in their debatable choices for hardware and layout.

I wanted to do something flexible but not too expensive nor flashy, much like the unbranded kits, but with better design practices in mind, and engineered to be heavily customizable.

Fully assembled Vanilla ORC-KIT with some extras.

Fully assembled Vanilla ORC-KIT with some extras.

Read More

Random Numbers, Distributions and Games (Part 2)

Continuing from my previous post on randomness, I’d like to talk about non-uniform distributions, which certainly don’t get all the love they deserve. When people talk or think about randomness in games, they commonly think about fair distributions. And I know we spent a lot of time in Part 1 actually trying to achieve perfect uniformity because it brings “fairness” to games,  but in reality, there are cases where you don’t want your random events to be ruled by a “fair” distribution at all.

Reality Check #4: Sometimes uniformity is bad

Fun fact: For a lot of “random” events in nature, every possible outcome rarely has the same chance of occurring, so perhaps trying to achieve that uniformity in games could be a mistake to begin with.

Let’s take rabbits for instance.

Yes, rabbits.

If you observe the population of rabbits of a given area, you’ll notice that they’ll have a”typical average size”. Let’s call that size X. You’ll find that most rabbits in the area will be around that size. There will be a rare few that are either considerably smaller than X or considerable bigger (outliers), but for the most of it, rabbits will be “just around” X in size. Same goes for any other quantifiable trait that depends on enough factors to be considered random.

They will most-likely follow what is called a Normal (or Gaussian) distribution, which is said to appear in nature all the time. The function that defines this distribution is also called the Gaussian Bell, due to the shape of the curve.

Read More

Random Numbers, Distributions, and Games (Part 1)

DISCLAIMER: This is a rather long post on the topic of random numbers, so …uh, sorry for that. 

I want to talk about a couple of interesting things related to randomness and its many nuisances especially when applied to games. But before we get to that I guess I’ll introduce the basic notions for those of you who are not familiar with this whole thing. You can skip the first two sections if you know what a PRNG is, and how it works.

What is Random

Random is commonly defined as “unpredictable“. In general, when we are unable to find a pattern that would allow us to anticipate the outcome or occurrence of an event, we call it “unpredictable” and there’s a chance we will consider the event “random”.

You’ll also hear of “true randomness”, and things like natural atmospheric noise, lightning bolts, or particles falling from the space being used as sources and examples of it. But while we can’t currently predict when and where lightning will hit, events in the universe like electric discharges in clouds are most likely just a massively complicated function of a number of different factors, and not really something that happens with no rhyme or reason. It’s quite possible that if we were able to simulate each particle and sub-particle inside a group of storm clouds and their relevant vicinity, lightning would be trivial to anticipate with accuracy. This makes its “unpredictability” debatable,  I guess.

Having said that, let’s not forget that “predictable” and “unpredictable” are relative to an “observer”.  What we consider true random events could totally have a logic behind, but what matters is that from our -and our system’s- point of view, they are impossible to predict, and if the machine (or person) is unable to anticipate the occurrence of an event, the definition applies, regardless of the event’s “actual” predictability.

Read More

TFT Adventures (Playing with a ILI9341-based display)

Not long ago I purchased a few 320×240 touchscreen displays from ebay that looked pretty decent and were also fairly cheap. They conform to the Arduino shield form-factor, so they snap directly  onto any standard Arduino board, making them really easy to test and use. They also have an integrated microSD slot (connected to the same bus used by the display controller) which is a nice touch and widens the number of possible applications for these modules.

As seen on literally every eBay listing that sells them.

As seen on literally every eBay listing that sells them.

Of course the displays didn’t come with any code, and the most reasonable thing you’ll find online to make them work is Adafruit’s TFT-LCD Library, which includes support for a number of different controllers, and is fully compatible with their very own and versatile GFX framework.
Read More

DIY Desk Clock

I used to have a small desk clock that I purchased for a trip. It was cheap but it had some really nice features that I quite liked. It had large digits that I could see from my bed each morning, and it was also able to measure and display the current room temperature, which I always thought was incredibly cool for a clock.

The problem is, that it required a lot of batteries to work; 4XAAA for the fancy LCD backlight and soothing RGB glowing action, and 2xLR66 (button cells) for keeping the thing ticking and actually displaying time and temperature on its LCD screen.  It worked reasonably well, but it was running through the batteries way too fast, in my opinion.

I didn’t really care about the AAA batteries dying in a month, because I could always use rechargeable batteries there, but the small LR66 batteries were killing me. Replacing them each 5-6 months or less wasn’t really a pleasure, especially since it meant setting time, date and alarms all over again, every time.

So I adventured in the journey of building my own clock. My main objective was to keep the number of batteries low, while also having the nice features of my previous clock, like the big numbers and the temperature readings.

SPOILERS: This is what I ended up making. No, it's not a bomb.

SPOILERS: This is what I ended up making. No, it’s not a bomb.

Read More

USB Adventures Part 2: Custom HID and USB Composite Devices

So in a previous post I’ve discussed how to communicate with a custom HID device using libhid and a Raspberry Pi running linux.

This post is a sort of sequel. I’ll talk about some of the issues and nuances I found when working on a more complex (but related) project; In this case a  Composite USB Device that I had to implement on a PIC 18F4550 microcontroller.

Read More

Temperature Sensors

I wanted to add a temperature sensor to a project I’m working on, and while I already had selected the perfect IC for the job, I decided to test a couple of other options I had, to see how they fare in comparison. I was originally going to compare only 3 sensors; the popular LM35, the not-so-popular LM335 and the kinda obscure TMP75, but as I started writing this post I  remembered I got a Dallas DS18B20 as part of kit of sensors, so I added it to the mix to balance the digital-to-analog ratio of this comparison.

The original 3 sensors I was going to test.

The original 3 sensors I was going to test.

Read More

Extremely Simple Yet Practical Soldering Fume Extractor

If you have any experience with a soldering iron, or soldering electronic components in general, I’m sure it will come as no surprise for you that the “fumes” produced by the process are not exactly good for your health. They can be quite harmful in fact (** depends a bit on the chemical composition of the solder you use). Even if they weren’t, they are -at the very least– annoying as hell. They always find their way to your eyes and throat in the most unpleasant ways.

I discovered some time ago that a device specifically designed to cope with this issue existed, and it’s been in the market for a quite a long time. This unbelievable product of heaven-sent technology and engineering is unsurprisingly called Soldering Fume Extractor (I bet you didn’t see that coming) which is nothing but a pompous name for a small desktop fan with an active carbon filter.

Read More

A RS232 TTL adapter for Vintage FX Casio Calculators and other devices


Casio FX-880P

It’s been with me for more than 10 years.

Back in the ’80s, Casio produced a line of calculators that was sold and advertised as “pocket personal computers”. This branding started with the PB-100 I believe, but the device concept started with a previous model, the FX-702P, produced in 1981.

While by today standards that claim seems a bit of an stretch, it held quite a bit of ground back then. These calculators featured a BASIC interpreter built-in, and internal memory to store user programs. They also featured a proprietary port/interface that allowed some Casio peripherals to be connected to the device, like a printer or a cassette drive. Personal computers back then were not much more than that.

The FX-850P model released in 1987 -and other calculators that followed- were a significantly step forward since their peripheral options (via the Casio FA-6 Casio interface) included standard Centronics parallel port and RS-232 serial connectivity, both ports widely used in computer hardware.

The FX-880P, released in 1990, was (I think) the last device in this line of Casio personal computers / calculators, and was basically a FX-850P with 32KB of RAM (instead of just 8KB).

When I was a kid I used to see this calculator in store catalogs and magazines and always wanted to have one. Many years later, when I was old enough to purchase my own stuff, I was finally able to get one (second hand) in pretty good condition, and I still use to this day.

Read More

Gameboy / GBC development tools

If you follow me on Twitter, you might have seen this 1 year ago:

Followed by:

Although I think I never ever posted anything after that, I was definitely working on such a tool, focusing particularly on Gameboy Color development (and as you can see I got it working).

Read More