Arduboy FX

I recently picked up a neat little device called an Arduboy FX. It was a bit of an impulse buy after someone posted about getting one on Threads. It turns out it’s not actually particularly new, the community goes back quite a few years, but it’s still pretty cool none the less, and I am happy with my experience with it.

So what is it? It’s a small credit card sized handheld based on the Arduino. On a related note, it’s “credit card sized” in footprint, not so much in thickness. I wouldn’t trust putting this in a wallet at all, because I feel like my fat ass would snap it if I sat on it. The form factor is worth mentioning though. Traditionally for handhelds, I prefer the “larger options”. I had the full sized 2DS, and the XL 3DS and the large wide Retroid, and I just like, more hand real estate. Despite the Arduboy’s pretty small size, it’s still surprisingly comfortable and I don’t have any problem using it.

Also, the platform itself is open source, so one could buy components and just, build their own, if desired.

This specific version, the Arduboy FX, is different from the older original release, simply called the Arduboy. I believe the main (and possibly only) difference is that the FX includes an add on FX chip and has 200+ built in applications and games. When I ordered mine, I noticed that they sell just the FX part as an add on for the original Arduboy. They both play the same games, but the original can only play one game at a time, whatever is loaded onto it from the Arduino software. You can still load custom games to the Arduino FX.

One thing I want to mention, because it was the first question I had. What happens to the default games when you load a custom game. the answer is, they are all still there. When you upload a custom game or code from the Arduino software, the new game will load, unless you select a game from the included games list. If you choose and load another game, it will overwrite the custom game. I believe there ARE ways to overwrite the original 200 games firmware, but the standard method of upload through the Arduino IDE, does not.

As far as I can tell, most of the worthwhile available games are pre loaded on the Arduboy FX. Basically everything about this is open source in nature. I’m not going to cover any real specifics of the games here, I may do that later over on Lameazoid.com though.

The fun part here is developing games. There is a great multipart tutorial available here, though the last two parts to build Dino Smasher are not complete. The Arduboy is based on C and C++ like the Arduino is. It uses a special library to work the Arduboy functions for button presses and graphics. The tutorials are good and could be done by someone who has no programming experience, though I’ve had pretty extensive experience at this point and they were a nice refresher for my C/C++ knowledge, which I have not used in almost 20 years.

I don’t recommend the other tutorial path though, for the platform game. I’ll be blunt, its presented as beginner-ish, but it’s quite a few levels above the first set of tutorials. It introduces a lot of much more abstract coding concepts. It’s probably good information, but it’s kind of beyond a basic level and many of the comments in the community expressed as much. I was a bit worried when right out of the gate it’s starting with various types of int (integer) variables which can be used. I mean, that’s all great to know, but for the purposes of anything made here, just using int, is going to be fine.

I went through the first tutorial set myself, and built the Pong Game. This is the second time I’ve made Pong funny enough, the first being in Python. After finishing the tutorial, I went through and added a bunch of additional features. Most were things done by other commenters, but rather than pick through their code, I just made a list of ideas and added them all in. I’d recommend it for anyone looking to test their ability a bit beyond this Tutorial, especially if you have some coding ability and want to flex yourself a bit. Here is a little list of suggestions.

  • Add a pause option (easiest is when pressing A during a game)
  • Add a more complex Title screen and End Screens
  • Add a “net” line down the middle.
  • Add an ability to adjust the paddle size (this will probably also require adjusting the AI sensitivity to make the game winnable)
  • Add the ability to select how many wins are needed to win
  • Make the game a bit better by offsetting the ball starting location after scoring.
  • Make the game a bit better by starting the paddles in the middle (The AI tends to miss the first 2-3 shots right out of the gate otherwise)
  • These last couple will need to be added to the title screen.

Anyway, My finished code can be found here.

I’m pretty happy with the result. I’m looking a bit into how to embed these games into my website here, or on my Github.io page. Until then you’ll need an Arduboy to actually run the code.

I’m not sure what I want to do next yet. I may make a go at building a simple Tic-Tac-Toe game, from scratch, just to have a simple project to test my coding chops without using a Tutorial as a base. After that, I am thinking of remaking one of the first games I ever made, a simple text based RPG I had made back in High School called Dragon Quest.

Dragon Quest was vaguely based on Dragon Warrior, which at the time, I didn’t know was actually called Dragon Quest in Japan. The game itself wasn’t actually anything LIKE Dragon Warrior though, it just, was fantasy based, and had Dragons, and the name “Dragon Warrior” was taken. (and like I said, I didn’t know at the time Dragon Quest was ALSO taken, by Dragon Warrior). That game, would be well suited to remake for the Arduboy though as it too was for a simple 2 color platform, I had built it on my TI-85 Calculator. Unfortunately, I don’t have any of the code from it. A lot of people in school had gotten copies of it on their own calculators, and Iw ould get copies back after school forced my calculator to be wiped for tests, to prevent cheating. Also, my calculator is 25 years old now, so the memory has more than wiped itself. I did eventually get a TI-85 data cable, but not in time to save my RPG game code. But I still have a basic idea of how the game worked.

I may try to make the “first game”, which was just a loop of battling and healing in town, with two monsters and an end boss. Then expand it to be more like the second game which was similar, but added equipable items, more monsters, and just more complex game play. If that works out, I can try to add in the map system I had planned to use for a 3rd iteration, written in C, that I had never finished. I do have the code for that floating around.

Battery Testing with Raspberry Pi

Recently I purchased a portable phone battery on clearance. I want to use it to modify my defunct Pokemon Go Gotcha band, which no longer holds a charge, to run off the battery pack. I realized that a battery pack could also be useful for powering other small electronics, such as the Raspberry Pi.

The problem is, I wanted to get an idea of how long the battery would last powering the Raspberry Pi. Figuring this out isn’t really all that hard. The tricky part is that I can’t stand over the Pi and watch it until it dies.

So instead I set up a simple cronjob task to do the job for me. I had a spare SD card, so I threw a basic fresh install of Raspbian on the card. I configured SSH and WiFi, then did a quick run of “crontab -e”, then droped the following at the end.

*/5 * * * * date >> /home/pi/date.txt

Simple.

Every 5 minutes, the Pi will now write the Date and Time to the file “date.txt”. It will do this until it can’t which would be after the battery dies, killing the Pi.

After charging the battery pack over night, I stuck the Pi on it and left it.

After checking back periodically, when I found the Pi was dead, I plugged it into a regular power source to retrieve the data. The result were both better than I had hoped, and not as great as I had hoped. The Pi started spitting out Time Stamps again after I plugged it back in, so I ended up having to skim through the file to find the time gap. I went ahead and truncated the data down to hour stamps until I came across the time jump from when the Pi had died and when I had plugged it back in.

So it turns out that the Battery pack will drive power for the Pi for around 12 hours. I also want to test this under a bit of a load and test how long it will power an Arduino writing to a remote database.

A Pile of Used Tech

I recently had an idea occur to me that I might be able to pick up used Raspberry Pis off of eBay more affordably than buying them new. I didn’t really find a ton of savings, but I did pick up an auction for a lot of various parts for fairly cheap.

I am not sure what I’m going to do with all of this, but it seemed like a deal for around $50. I was worried that it wouldn’t all be included, but it was. Not everything is what I had hoped though. Two of the three Raspberry Pi 2s seem to be dead. I’ve tried several trouble shooting methods so far. They turn on, but don’t seem to real SD cards at all.

The arduino is a genuine Arduino, which is nice, but its a fairly older model. Not a huge issue, but it is what it is. The screens were a nice bonus. I’ve been looking into getting a screen of some sort of my Pis, possibly for a RetroPi handheld build. I have not tested the larger screen yet, it seems to work off of a funky daisy chain of an extra board and some cables. I did get the smaller screen working… ish.

It’s a nice little touch screen that fits nicely on top of the Pi. I have not had a chance to properly troubleshoot it, but the touch works kind of funky on it. For one, it seems to function more like a track pad than a straight touch. Two, the mouse cursor only wants to move along a diagonal axis across the screen.

This all kind of feels like a configuration issue however, so there is some hope. Plus I am not sure I really need a touch interface for a RetroPi handheld build.

There’s some other fun stuff that I have not had a chance to mess with yet. There were a ton of ultra sonic sensors. I’m not sure what exactly these could be useful for, but I am wondering if they would be able to do 3D imaging of an object or a space.

There’s some funky board with a digital display on it that seems to be some sort of power board. I am not sure I’m going to have a use for this at all.

Lastly, there is a Raspberry Pi camera module. I have not had a chance to test it out yet, but like the screen, this was something I’ve been wanting to try out.

Saving a Slice of Raspberry Pi

Raspberry_Pi_LogoSo of all the things on the network, the DNS and DHCP server are pretty important.  Especially because my experience has been the router the ISP provided is kind of mediocre at doing the DHCP job.  So when the Raspberry Pi I’ve tasked with doing the work started flaking out I was a little worried.

After some investigation, it seems the SD card had lost a sector, or whatever the equivalent thing is to a sector on flash memory.  These things do have a bit of a limited life and this particular one was a small 4GB card that was a little older.  Four gigabytes isn’t even above the recommended size for the Pi, but I knew I wasn’t planning on putting a lot on it.  Problems arose when it started dying though.  There actually isn’t much using the PiHole, some of the things my wife does with coupons and such I suspect might get blocked and I don’t want the headache of dealing with trying to manually whitelist things and complaints that this and that isn’t working.  The DHCP is another issue.  When the DHCP server disappears, it seems anything using it simply can’t connect to the internet.  I have a lot of static assignments but there’s quite a few assigned by the server.

I may have to look into setting up a secondary backup server, maybe on one of the CHIPs even.

I started out simply re-imaged Raspbian onto a fresh card and setting things up again following the tutorial I had posted.  Everything went pretty smoothly except that I was now out my old config file and would have to go through the hassle of recreating all of the changes I’d made adding and removing devices.

So I went with a new strategy, why not just clone the old card to a new one.  Unfortunately, Win32 Disk Imager, the recommended tool for imaging these SD cards, couldn’t read the whole card, it got hung up and failed partway in.  So I turned to my laptop and Linux hoping for something more robust, which I found in ‘dd’.  It probably stands for “Disk Duplicator”, but don’t quote me on that.

I started running dd to make an image of the old card to put onto a new card, unfortunately, it also failed, like Win32DiskImager.

Back to Square One…

After some searching, I found this post suggesting something called ddrescue.  Most of it wasn’t anything I needed aside from the following.

sudo apt-get install gddrescue
sudo ddrescue -v /dev/sdb /dev/sdc

A few things of note.  My laptop, like many, has a build in SD slot, I added a second using my USB card reader.  I opened the disk manager to get the path to each card, /dev/sdb and/dev/sdc.

This command also hit an error at the same point as both Win32DiskImager and the “dd” command, but it pushed on through, recovering everything else.  At this point it’s a matter of hoping that one bad spot wasn’t int he middle of an important file.

Internet of Things, Internet of Stuff

I wanted to take some time to touch on my every changing collection of Internet of Things style devices.  Honestly, it’s kind of iffy what constitutes an “IOT” device, but for the most part I’m sticking with “cheap” and “non traditional computing devices”.

The chief player among these are of course…

The Raspberry Pi

I’m up to 5 Raspberry Pis, a B+, two B2s, one B3, and one Pi Zero.  I have already discuss these quite a bit so they don’t need a ton of additional discussion.  The B+ still operates my DNS/DHCP server, one B2 still runs my IRC stuff, one B2 still runs a Minecraft server.  I actually have not yet come up with a good use for the B3 and Zero yet.  I’ve started messing with Windows 10 IOT on the B3 a bit and there is a Retro Gaming GameBoy project using the Pi Zero floating around on Reddit I may have a go at.

Arduino

If Raspberry Pi is the king of IOT, then Arduino is definitely the Queen. I’ve kind of dropped out of doing Arduino projects a bit and dismantled most of the ones I had built.  Other than adding a WiFi enabled board to my set (by mistake, I thought I was ordering a Shield not a board), not much has changed on my Arduino library.

i did try to build a little digital hourglass project I found online but it’s not going super great.  Stay Tuned for More

Next Thing’s CHIP

CHIP is still one of the most annoying and impossible to search for terms online.  I’m up to three CHIPs now, I’ve received my second Kickstarter CHIP and my VGA DIP.  I’ve still been having some bad luck getting my CHIPs to do much of anything.  I tried to build an Amazon Alexa with no luck in the end after a ton of troubleshooting.  I’ve been trying to get Synergy combined and running on one to let it work with my multi monitor set up.

Now that the Kickstarter campaign is more or less finished and the CHIP is reaching a wider audience I’m hoping it starts to get more support online.

Remix Mini

Another kickstarter product, the Remix Mini is a small computer that runs Android as a desktop.  It works pretty well, I mostly used it last year while traveling for work in the Hotel Room.  I have not touched it since, for one simple, stupid reason.  The HDMI output doesn’t support any of my HDMI to DVI cables.  I can’t plug it into a regular monitor, so I just have… not used it.  I could plug it into a TV but it’s effectively a simple desktop machine and doesn’t work as well for a “lean back” experience.  Maybe if I had a wireless KB and Mouse it would work better.

It’s a shame to because I was really looking forward to this one and it runs a lot of my apps surprisingly well.

ChromeCast

I picked up a Chromecast last year on Black Friday. I used it a bit but in the end, it’s ended up in a drawer.  It’s just too much of a hassle and it caused too many problems.  First off, the hassle.  My crappy old Nexus 7 is partially to blame here but in general the lack of any built in interface is just a flat out pain.  Having to dig out my tablet to use it is a pain.

Worse yet, it was causing problems with the Wireless in the house.  I disabled guest mode which eliminated the problem (eliminating the interference) but it’s still kind of lame that it was an issue to start with.

Kindle Fire Stick

A more recent addition to the network, I added a Kindle Fire Stick.  This is effectively the same as the Chromecast, without the hassle and bull shit of needing a separate device to use it.  It’s not completely without it’s issues but it works pretty well.  The main problem I’ve had is that it loses signal, a lot.  It doesn’t work as all directly hooked to my HDMI switch and at this point it’s cabled out and laying out on the floor behind everything to get it away from any interference.

It runs Amazon videos, which I don’t really use, it runs Netflix, which is used a lot.  It also works well with the fact that I buy my MP3s primarily through Amazon.  Another nice bonus, I use Amazon Cloud to backup all of my Photos, so they are all available through the Fire Stick now to view on the TV.

SteamBox

 Another newer addition is the SteamBox.  Specifically, the cheap streaming box.  It works pretty nicely.  I haven’t had a chance to really put it through the loops yet but my first tests worked well.  I’ll probably do a more in depth write up at some point on it.