Robots w/Lasers http://blog.davr.org Nintendo DS & GBA development, microcontrollers, and occasionally FPGAs Wed, 30 Sep 2009 16:14:23 +0000 http://wordpress.org/?v=2.8.6 en hourly 1 Nintendo Wii only $175! http://blog.davr.org/2009/09/30/nintendo-wii-only-175/ http://blog.davr.org/2009/09/30/nintendo-wii-only-175/#comments Wed, 30 Sep 2009 16:12:31 +0000 davr http://blog.davr.org/2009/09/30/nintendo-wii-only-175/ a $25 gift card when you buy a Nintendo Wii for only $199]]> Ok, technically it’s $199, but Amazon is currently offering a $25 gift card when you buy a Nintendo Wii, which you can then use towards extra controllers, games, etc. It’s really quite a good deal. Not only that, but they are actually in stock. Back when I bought mine in Jan 08, they would routinely sell out within 15 minutes of getting more stock on Amazon.

Excellent games I’ve played and can recommend: Super Mario Galaxy, Mario Kart Wii, Rock Band 2, and Dokapon Kingdom

]]>
http://blog.davr.org/2009/09/30/nintendo-wii-only-175/feed/ 0
Comparison of Entry-Level (aka cheap) FPGA boards http://blog.davr.org/2009/05/18/comparison-of-entry-level-aka-cheap-fpga-boards/ http://blog.davr.org/2009/05/18/comparison-of-entry-level-aka-cheap-fpga-boards/#comments Mon, 18 May 2009 23:26:50 +0000 davr http://blog.davr.org/?p=92 A while ago I decided I wanted to play around with a FPGA – Field-Programmable Gate Array, basically it lets you design new hardware ICs (Integrated Circuits), without needing a multi-billion dollar chip fabrication plant. So I set out to research the available pre-made development kits I could play around with. They’re quite a bit more expensive to get into than microcontrollers (where you can buy a $3 chip and build a programming cable out of some old scraps of wire), so I looked for the least expensive boards that still had a decent set of features.

I ended up making a comparison chart of FPGA development kits, like I said this was over a year ago, so it may be a bit out of date, but the low-end of FPGA’s doesn’t move all that fast. Most of the information is still valid, but you might be best to do some research yourself before you take the plunge. I only considered boards that featured FPGAs from Xilinx and Altera, since I found other vendors are not competitive in the low-cost arena (low-cost was the most important feature to me at the time, I didn’t want to spend $5000 just to play around. And yes, there are $5000 development boards).

View Chart Full-Screen

If you’re curious, I ended up getting the DE2 (with the educational discount). It costs a bit more, but it has significantly more features, such that I’ll probably never run out of stuff to play with.

The ones highlighted in green are the ones I feel provide the best value, and just coincidentally fall at the $50, $100, and $150 price points.

]]>
http://blog.davr.org/2009/05/18/comparison-of-entry-level-aka-cheap-fpga-boards/feed/ 3
True AdBlock for Chrome browser http://blog.davr.org/2009/03/18/true-adblock-for-chrome-browser/ http://blog.davr.org/2009/03/18/true-adblock-for-chrome-browser/#comments Wed, 18 Mar 2009 15:52:17 +0000 davr http://blog.davr.org/?p=89 I’ve just discovered a true adblock plugin for Google’s Chrome web browser. What these guys have done, is taken the Chrome sourcecode (aka Chromium), stripped out Google’s tracking features, and added in a clone of AdBlock Plus. There’s no fancy UI for it yet, but it supports real regex ad-blocking, unlike those other hacks that either require you setting your hosts file with a million lines, or some annoying proxy you have to configure, or a silly bookmark you have to click on every page.

Check it out here: SRWare’s Iron. As mentioned in the news, make sure to download adblock.ini and place it into the program directory after downloading.

Enjoy the power of Chrome, with the convenience of adblock!

]]>
http://blog.davr.org/2009/03/18/true-adblock-for-chrome-browser/feed/ 0
HDR-like photo fun http://blog.davr.org/2008/09/03/hdr-like-photo-fun/ http://blog.davr.org/2008/09/03/hdr-like-photo-fun/#comments Wed, 03 Sep 2008 21:49:28 +0000 davr http://blog.davr.org/?p=82 I’ve been playing around with making HDR photos from only hand-held shots. Mainly because I’m too lazy to always go and get my tripod, set it up, attach the camera, etc etc. It’s a lot easier to just stand there & take a few shots at different exposures while holding the camera as steady as possible.

In the past, all the HDR processing tools required that your images were taken on a tripod and perfectly aligned, or if they weren’t aligned, it could do some simple corrections, but anything too complex would mess it up.

I’ve tried several applications, including Photomatix Pro, PTGui Pro, and Autopano Pro. I know what you’re thinking, two of those three applications are mainly for automatically stitching panoramas…but it turns out automatically aligning images for panoramas is also very useful for creating HDR images.

My very quick comparison of these HDR / panoramic image apps: Photomatix Pro appears to give the most control over the HDR generation process, and with tweaking, gives the nicest output…HOWEVER it’s not very good at handling images which are not perfectly aligned. Autopano Pro is the best at correctly aligning the images, and for creating panoramas in general, but it sucks at HDR tone mapping, having two sliders with obscure labels, that don’t really make it look very nice.
Finally, there’s PTGui Pro — it’s not the best at aligning, and it’s not the best at the HDR generation, but it’s pretty good at both, so in most cases it gives the best overall results.

Below, you can see an example of a shot I took, that would be impossible without some sort of HDR effect:

Original images:


This one is way too dark to see the indoors at all, but you can see out the window pretty clearly.


This one’s a bit brighter, you can make out some of the indoor stuff, but the outdoor shot is already getting a bit too bright


In this one, you can make out the indoor scene pretty clearly, but the light from outside completely blows out that section of the image.

These three images were combined using PTGui Pro, with the ‘Exposure Fusion’ HDR processing option, and I tweaked the sliders around until it looked nice. Here is the resulting image:


(click to enlarge)

As you can see, both the indoor and outdoor scene are visible, and the image as a whole has a subtle effect applied to it that you don’t normally see in digital photography (outside of these HDR type of shots).

]]>
http://blog.davr.org/2008/09/03/hdr-like-photo-fun/feed/ 3
Simple Cellular Automata Example in AS3 http://blog.davr.org/2008/08/22/simple-cellular-automata-example-in-as3/ http://blog.davr.org/2008/08/22/simple-cellular-automata-example-in-as3/#comments Fri, 22 Aug 2008 19:33:39 +0000 davr http://blog.davr.org/?p=80 To get a little more experience with ActionScript 3, I wrote up a very simple class which will take a rule number, and then generate a cellular automata based on that.

The movie below requires Flash 9 or above to be installed. Some rules to try out: 90, 30, 73, 110, 150. Valid numbers are 0-255, but not all produce interesting results.

Direct link to flash movie (got some people complaining the SWFObject script doesn't work under Vista)

See Wikipedia for more info, and Wolfram.com has a list of all 256 possible results
Here's the code:

Actionscript:
  1. /**
  2. * Simple Cellular Automata example
  3. * by David Rorex, 2008
  4. */
  5. package
  6. {
  7.     import flash.display.*;
  8.     import flash.events.*;
  9.     import flash.geom.*;
  10.     import flash.text.*;
  11.     import flash.ui.Keyboard;
  12.     import flash.utils.getTimer;
  13.     import sim.EasyButton;
  14.        
  15.     public class Main extends Sprite
  16.     {
  17.         /// Holds the data we draw onto
  18.         private var bdata:BitmapData;
  19.        
  20.         /// Bitmap container for displaying our rendering
  21.         private var bitmap:Bitmap;
  22.  
  23.         /// Text field for typing in rule numbers
  24.         private var inp:TextField;
  25.        
  26.         /// Button to click to render
  27.         private var btn:EasyButton;
  28.        
  29.         /// Constructor
  30.         public function Main():void
  31.         {      
  32.             // set up the input textfield
  33.             inp = new TextField();
  34.             addChild(inp);
  35.             inp.type = TextFieldType.INPUT;
  36.             inp.border = true;
  37.             inp.text = "90";
  38.             inp.addEventListener(KeyboardEvent.KEY_UP, onEnter);
  39.             inp.height = 20;
  40.            
  41.             // set up the render button
  42.             btn = new EasyButton("Render");
  43.             btn.addEventListener(MouseEvent.CLICK, function(e:*):void { doRender(); } );
  44.             addChild(btn);
  45.                        
  46.             // set the stage to not scale, and to get an event if the window changes size
  47.             stage.scaleMode = StageScaleMode.NO_SCALE;
  48.             stage.align = StageAlign.TOP_LEFT;
  49.             stage.addEventListener(Event.RESIZE, onResize)
  50.            
  51.             // initialize the size
  52.             setSize(stage.stageWidth, stage.stageHeight);
  53.         }
  54.        
  55.         /**
  56.          * Event handler for when the stage changes size
  57.          * @param e
  58.          */
  59.         private function onResize(e:Event):void {
  60.             setSize(stage.stageWidth, stage.stageHeight);
  61.         }
  62.        
  63.         /**
  64.          * Event handler to catch the user pressing ENTER in the text field
  65.          * @param e
  66.          */
  67.         public function onEnter(e:KeyboardEvent):void {
  68.             if (e.charCode == Keyboard.ENTER)
  69.                 doRender();
  70.         }
  71.        
  72.         /**
  73.          * Simple method to call the render function
  74.          */
  75.         public function doRender():void {
  76.             render(parseInt(inp.text));
  77.         }
  78.        
  79.         /**
  80.          * Adjust the positioning of our elements based on a given size
  81.          * @param w
  82.          * @param h
  83.          */
  84.         public function setSize(w:Number, h:Number):void {
  85.             btn.x = w - btn.width;
  86.             inp.width = w - btn.width - 2;     
  87.         }
  88.        
  89.         /**
  90.          * Render cellular automata.
  91.          * @param ruleNum - the number of the rule to draw. Some interesting numbers are '30' and '90'
  92.          */
  93.         public function render(ruleNum:int):void {
  94.            
  95.             // clean up previous bitmap
  96.             if (bitmap != null) {
  97.                 removeChild(bitmap);
  98.                 bitmap = null;
  99.             }
  100.             if (bdata != null) {
  101.                 bdata.dispose();
  102.                 bdata = null
  103.             }
  104.            
  105.             // get width and height of the stage
  106.             var w:Number = stage.stageWidth;
  107.             var h:Number = stage.stageHeight - 20;
  108.                        
  109.             // build lookup table based on the rule number
  110.             var rule:Array = [];
  111.             for (var i:int = 0; i <8; i++)
  112.                 rule[i] = (ruleNum>> i) & 1;
  113.            
  114.             // create bitmap data that we will draw into
  115.             bdata = new BitmapData(w, h, false, 0);
  116.            
  117.             // lock the bitmap data, provides speedups when you are doing a lot of manipulations
  118.             bdata.lock();
  119.            
  120.             // set the starting data - a single pixel in the center
  121.             bdata.setPixel(Math.round(w/2), 0, 1);
  122.            
  123.             // loop row by row
  124.             for (var y:int = 1; y <h; y++)
  125.                 // loop pixel by pixel
  126.                 for (var x:int = 0; x <w; x++) {
  127.                    
  128.                     // use lookup table based up 3 neighboring pixels to calculate new pixel
  129.                     bdata.setPixel(x, y,
  130.                         rule[bdata.getPixel(x - 1, y - 1) <<2
  131.                            | bdata.getPixel(x    , y - 1) <<1
  132.                            | bdata.getPixel(x + 1, y - 1)]);
  133.                           
  134.                 }
  135.            
  136.             // map the pixels, 0-white, 1-black
  137.             bdata.paletteMap(bdata,
  138.                         new Rectangle(0, 0, w, h), new Point(0, 0),
  139.                         [], [], [0xffffff, 0]);
  140.            
  141.             bdata.unlock(); // unlock the bitmap data
  142.            
  143.             // create the bitmap to hold the data
  144.             bitmap = new Bitmap(bdata, PixelSnapping.ALWAYS, false);
  145.            
  146.             bitmap.y = 21;
  147.            
  148.             addChildAt(bitmap,0); // add it to our display list so we can see it
  149.         }
  150.     }
  151. }

]]>
http://blog.davr.org/2008/08/22/simple-cellular-automata-example-in-as3/feed/ 3
ICANN haz new TLDs? http://blog.davr.org/2008/07/07/icann-haz-new-tlds/ http://blog.davr.org/2008/07/07/icann-haz-new-tlds/#comments Tue, 08 Jul 2008 06:53:21 +0000 davr http://blog.davr.org/?p=79 So apparently ICANN has decided to start allowing people to purchase new Top Level Domains. Existing ones are things like .com, .net, .info, .biz, and so forth. They are going to charge a hefty $100,000 for the privilege however. Personally I think it's a terrible idea, and it's just a plot to make some quick money on their part. Anyway, my buddy guesses there will be 950 vanity TLDs registered in the first auction (where a vanity TLD being one that refers to a company, person, organization) I say that's way too high, I'd be surprised if there were over a hundred.

]]>
http://blog.davr.org/2008/07/07/icann-haz-new-tlds/feed/ 0
Partial MIDP support on the DS http://blog.davr.org/2008/06/09/partial-midp-support-on-the-ds/ http://blog.davr.org/2008/06/09/partial-midp-support-on-the-ds/#comments Mon, 09 Jun 2008 17:41:54 +0000 davr http://blog.davr.org/?p=78 ole has taken my KVM port to Nintendo DS and added some updates. I haven't played with it much, but he lists the changes as follows.

R3: New features added by Ole:

  • fixed the CLDC implementation (timer, memory size, system properties)
  • added support for reading of the PNG images (code taken from the PhoneMe project)
  • implemented native functions for rendering the basic graphics primitives on the screen
    (lines, rectangles, triangles, images)
  • added support for accepting the JAD files in the application browser
  • added the core part of the Pstros MIDP library
  • added VideoTest example to show how to draw on the screen
  • added '_rebuild.bat' to show how to build and preverify the class files.
    Note WTK installation is required.

This is quite interesting if it is able to run some MIDP-compliant games, but we'll need to do some testing to see how the speed compares to your average mobile phone.

UPDATE: He's made a few more updates since I originally made this post. Be sure to check out ole's site for the latest info and download links.

]]>
http://blog.davr.org/2008/06/09/partial-midp-support-on-the-ds/feed/ 5
DLDI-support for Mandelbrots http://blog.davr.org/2008/05/05/dldi-support-for-mandelbrots/ http://blog.davr.org/2008/05/05/dldi-support-for-mandelbrots/#comments Mon, 05 May 2008 17:59:43 +0000 davr http://blog.davr.org/2008/05/05/dldi-support-for-mandelbrots/ Just a tiny update to my homebrew mandelbrot browser for Nintendo DS. This version merely adds DLDI-support, meaning you should be able to save screenshots as .PNG from pretty much any flashcart. Check the previous post for screenshots, more info, etc. To the right is an actual image saved from the program.

Download r06 .nds

]]>
http://blog.davr.org/2008/05/05/dldi-support-for-mandelbrots/feed/ 4
It Works! http://blog.davr.org/2008/01/09/it-works/ http://blog.davr.org/2008/01/09/it-works/#comments Thu, 10 Jan 2008 02:54:49 +0000 davr http://blog.davr.org/2008/01/09/it-works/ I've finished assembling my little gadget...and it works! As a side note, Flux is super handy, it made soldering the tiny SMT stuff really easy, also I learned a few tips from this video.

I ran into one small problem: on the board, I added a JTAG port for in-circuit programming & debugging. However, my cheapo JTAGICE mkI (not mkII) doesn't support the newer AVR chip I put on the board. So I had to hack in an ICSP port, hence the four ugly green wires coming out of the middle of the board. But once I got that in, I updated the program I had running on the prototype. There were just some minor changes, IO pins were mapped differently, and the syntax for using Timers was slightly changed.

Now that the hardware is essentially done, I need to write some more software, get a few polished minigames on there.

UPDATE: Please enter your email address, I'm trying to find out if there's any interest in these devices. If enough people subscribe, it will encourage me to do something about it :)

You can download a short video, or watch it online here:


PS: I bought enough parts (including the PCB) to build two of them...so if anyone wants to buy one, please feel free to make me an offer in the comments below :D

]]>
http://blog.davr.org/2008/01/09/it-works/feed/ 12
PCB Received from Olimex http://blog.davr.org/2008/01/04/pcb-received-from-olimex/ http://blog.davr.org/2008/01/04/pcb-received-from-olimex/#comments Fri, 04 Jan 2008 20:00:55 +0000 davr http://blog.davr.org/2008/01/04/pcb-received-from-olimex/ Over the christmas holiday I received my PCBs back from Olimex. They look very professionally made, it's pretty neat knowing that I designed it completely myself. In the picture to the right you can see the board with a few of the components. I haven't started soldering yet, but I've placed them on there so you can get an idea of how it will look when finished.

I'm waiting on the parts from Allegro before I can finish, I've requested samples of their surface mount pieces (previously I only got the ones in the DIP packages).

]]>
http://blog.davr.org/2008/01/04/pcb-received-from-olimex/feed/ 0