Wednesday, June 17, 2009

Developing in Objective-C

I thought I would spend a little time writing about my recent experiences with Objective-C. Recently I have been moving towards Objective-C as a language of choice, and after picking up a few books I found it one of the easier languages to pick-up in regards to syntax and overall clarity. After having spent far too much time in Java what becomes clear is how nice it is to have complete control, an attribute which makes C popular in its many flavors. It was quick to catch on to and with just a light background in C, it's quick and simple to recognize many of the subtle differences between C and Objective-C. Since Apple utilized Objective-C as their main language of choice for application development both on the Mac as well as the iPhone, it is critical language for anyone looking to get into programming on the Mac. Throw in the fact that Apple distributes XCode with every copy of OS X and you have the perfect start to delving into application development.

For anyone interested in getting down and dirty with Objective-C, I highly recommend Programming in Objective-C by Stephen G. Kochan, it is well written and offers some excellent examples, particularly for those who may not have a background in programming. What I like particularly about this book is how fluidly it moves from one topic to another. Kochan's examples are clear and concise enough that none of the points need belaboring and the progression of the chapters eases the reader into each stage with confidence. It is definitely worth checking out if you are interested in Objective-C.

It is probably worth mentioning that since this book does not get into Cocoa or any interfaces, a great read for becoming familiar with Cocoa is Cocoa(R) Programming for Mac(R) OS X by Aaron Hillegass


Tuesday, June 2, 2009

Switching to Mac

A good friend of mine owns two computers made by Apple and swears by them. Before I met him, I was sceptical about Macs and totally disliked them. What I didn't know was how much they have changed since the last time I used one, which was before the Intel switch. Windows can run natively on a Mac better than on most Windows based machines. Macs don't get viruses. Macs are stable. These are things I learned recently and key points that make me want to switch. Not only is a Mac stable, it can run for days, even months, without needing a restart. All the software you need to be productive is included, and it MUCH better than Microsoft's equivalent software, which costs hundreds of dollars. The hardware is far superior, with DDR3 memory and quick Intel core 2 duos in them. Being made out of aluminium, the Macbooks are light but extremely durable and sturdy due to the uni-body construction.
Being an engineering student, I need to run certain circuitry design programs for school which ONLY run on Windows. This is one of the biggest concerns for me. This can be easily solved by running windows XP, Vista, or 7 in a Virtual machine within OS X for my school program. Another issue I thought of was syncing my Windows Mobile 6 based smartphone with the calender, tasks, and emil on my computer. Under windows, this requires Outlook. Fortunatley, I have found some Mac alternatives which work just as well if not better than Outlook under windows.

So far I have been able to find nothing that will prevent me from being productive with a Mac. If anything, I will be able to work more efficiently because it will just work when I need it to. I will keep updating here when I get my Macbook Pro and I will post any complaints or roadblocks that I run into! Stay tuned.

Thursday, April 2, 2009

VEX Robotics

I was rummaging around in some video and pictures archives and ran across some footage from an Artificial Intelligence class I took as a senior in High School. It was based on the VEX Robotics system. Kits included various metal supports and brackets to build a frame, different sized gears, axles, axle bushing, software, tools, variable-speed motors, a servo, different sized tires, a micro-controller with USB-PC interface, IR and bump sensors, and various other bits and pieces. We were given challenges and had to build a robot that would overcome the challenge. The first challenge was to build a tank using the tank tread kit so that it would go over a wooden pallet, a cardboard box, and then push the cardboard box back towards the pallet. Here is the picture of the tank that my team "We Three Freaks" (WTF) built. It is radio-controlled and each motor is on its own channel. This tank was the only one to complete the challenge due to the extra traction provided by the wheel in the back.

Here is a short video of the tank driving over the cardboard box:



I will keep adding to this as I find more videos and pictures! Enjoy!

Friday, February 27, 2009

Sumo Bot - IR Sensor Test - FRONT



Finished up my first Sumo bot (1 of 2) and thought I would post some video of the IR Sensor test for the front IR sensors. If you watch, you can see that the Sumo Bot tracks the location of the bottle with the IR sensors, and when it loses the bottle, it will continue scanning in the direction that it last saw the object that it was tracking. There is still a lot of tweaking to do, and I plan on having a full write up soon on the construction and programming process of the Sumo Bot. I just wanted to get this out there and show you what was coming down the pipe

Saturday, February 14, 2009

My custom built digital picture frame

I have been wanting to get my parents a digital picture frame since ever since I started college. I really liked the the wireless-enabled ones because it made updating pictures very simple and easy but they were just too expensive and too darn small for my liking! So I figured I would do some research and build my own.

The Laptop

I had an old WinBook XL laptop in the basement with a 12 inch screen, plenty big enough for a picture frame! The battery had died a long time ago and even surfing the interneton this was painfully slow. The specs were perfect for this use though... 233mhz Pentium processor and 128mb of RAM. The hard drive was very loud so that had to be replaced. More on this soon.

Here is the WinBook before:
From Digital Picture Frame

To solve the loud HDD problem, I purchased an IDE to Compact Flash (CF) adapter and a 4GB CF card. The adaptor allowed me to use the solid state CF memory as the main HDD in the laptop! Silent and low power-usage... perfect!
From Digital Picture Frame

A PCMCIA Wireless laptop card was used for internet access to update pictures. Any card will suffice. I used a wireless G card that I picked up for $35 at WalMart.

The Software

Now that I had a working laptop, I figured it would be better to configure the software that will display the photos before taking it apart so that I had access to the CD and floppy drives, which will be removed/inaccessible once the frame is complete. For an operating system, Windows 2000 PRO was my best bet due to WIFI card capability and ease of use. Once Windows 2000 was installed and all updated, I installed a screen-saver software called Slickr. It downloads pictures from an online Flickr account and makes for easy updating of pictures on the frame. A simple change in pictures on an Flickr account changes the pictures displayed on the frame, without even touching the frame! More details on the Slickr screensaver can be found HERE.

The Frame

Once I had a working slideshow, it was onto building the frame. A lot of other people have built their own frames using pre-made picture frames and matting the screen. I decided to build my own frame to fit the laptop's screen. I had some scrap pieces of laminated tongue -and-grove floating floor in the wood pile. The thickness and finish was perfect. I removed the front bezel from the laptop screen and traced the inside of it on a large piece of paper to use as a guide for the inner size of the frame.

From Digital Picture Frame

The pieces of wood were too wide and I didn't need the tongue-and-groove on the edges so I ran the wood through the table saw set to the desired width. I decided to use 45degree angles to join the four pieces of wood for that real picture frame look. This was done using a radial arm saw set to 45degrees.
From Digital Picture Frame

One by one, the pieces of wood were marked using the paper template and placed on it to make sure everything was square. The finished product after some tweaking of the corners and before gluing:
From Digital Picture Frame

A little bit of wood glue on the faces of the 45s and a square strap made the frame face complete.
From Digital Picture Frame

Because the wood had been cut on the sides, it was bare wood. To clean up the inner and outer edge of the frame, a few coats of glossy craft paint was applied (by my sister) to finish it up.

From Digital Picture Frame

Putting it Together

Once the glue dried, it was time to start taking apart the laptop and assembling the frame. First thing was to remove the LCD from the laptop and mount it to the back of the wood frame.

Screen in laptop ready for removal
From Digital Picture Frame

Screen mounted to frame with backlight inverter board
From Digital Picture Frame

The rest of the screen assembly was removed from the base of the laptop as well as the keyboard. An external power switch was connected to the power switch on the laptop to be mounted on the back of the frame for easy access to on and off.
From Digital Picture Frame

I used the cover that the screen was originally mounted in to protect the delicate LCD panel. I simply hot glued this in place.
From Digital Picture Frame

As you can see in the photo above, the wires for video and power to the LCD panel are very short. This limited where the base of the computer could be mounted. Once I got the video and power cables connected to the motherboard, I dry fit the laptop. It was a little off center but was still well within the frame. A little hot glue between the laptop and the screen cover and a little more around the edge prevented the laptop from moving. To enclose and protect the laptop, I glued some scrap furring strips on edge to form a box. I used leftover pieces from the frame to secure the bottom and still allow access to the USB and power ports. The extended power switch was also mounted near the top for easy access.
From Digital Picture Frame

To finish up the back, I added a cross-member with a prop-rod to hold it up. The prop-rod has a string to adjust the angle of the frame. I intentionally left some space along the top to allow any hot air to escape. The entire back was then painted with the same gloss black paint for a clean finish.
From Digital Picture Frame

From Digital Picture Frame

The first run
From Digital Picture Frame

After one minute, the Slickr screen saver starts up, checks online for new pictures and displays the pictures in a slideshow.
From Digital Picture Frame

Here is the frame in use in my home. It was a Christmas gift to my parents.
From Digital Picture Frame

Final Thoughts

This project was fairly cheap and easy to do! I spent about $50 total and the rest was acquired free or found laying around. Try finding a 12 inch WIFI enabled digital picture frame for $50! And the best thing is it isn't made of cheap breakable plastic. It is all wooden construction securely glued together (so no screws show) which makes it heavy and thus hard to knock over. There are 2 USB ports exposed for a keyboard and mouse in the event of the frame needing maintance or updates. I am looking into remote connetion software for maintance. So far, it has not needed any maintance with the exception of the WIFI card needing to be replaced because it didn't talk nicley with my router.

I spent about 3 days configuring the software and building the whole frame. Before that, however, I spent a few weeks researching what other people did and my options for software. I would do this project again in a heartbeat now that I know what it takes. A few steps can be cut out if you want to use a pre-made picture frame and matte it. For my application, it would have been difficult to mount the laptop to a pre-made frame without a lot of complicated modification.

Tools and materials used

a few scrap pieces of floating floor, wood glue, old laptop, hot glue, various small screws, large switch and small wires, small phillips screwdriver, scrap wood, table saw, radial arm saw, square strap, black paint, string, soldering iron and solder, patience, and creativity.

Thanks for reading!