Archives

All posts for the month November, 2008

Finding the right Mouse

I have never been a connoisseur of input devices. However, recently I had to spend time trying to find something more acceptable. Over the years I have used whatever Apple supplied with their systems. My last few purchases have come with the wireless mighty mouse and I have to say it does not live up to the Apple standard. I currently own three of them and I can say the quality of the mighty mouse is not up to par. In fact one of the mice the middle track ball does not scroll downward (and it is not a preference setting). The mice seem clunky and sluggish and they are very picky about the surface they track on. As a programmer this is very frustrating. I typically have a desk full of opened reference books as well as other items which i use as a mouse pad for which the mighty mouse simply will not track on. I am forced to clean a spot off some where so that the mouse will work. The battery usage on this mouse is also ridiculous. It eats batteries like crazy. This problem is not isolated to only one of them. After dealing with this for well over a year I finally had enough. I recently purchased a logitech mx60 wireless mouse and it is worlds above the mighty mouse. It has a very comfortable feel and tracks on any surface. There is very little lag when it tracks. It also sports a very long battery life enhanced with a small power button of the bottom to make it last even longer. Most reviews for this mouse has been very positive. If you are looking for a good mouse for your mac give this one a try. See the link below.

Serial Port Programming in Cocoa

I am currently working an a sprinkler controller program that controls a relay board to turn a lawn sprinkler system zones on and off at specific time schedules. One of the interesting things I have learned is serial programming on the Mac. Unlike previous programs I have written I decided to use pure cocoa to communicate with the relay board. The board is 8 output 4 input serial board with an RS232 connection. So, the question is how do I communicate with this board from the mac since there is not a rs232 port on the mac and where is the device file?. On unix system the serial port appears as a device file in the /dev directory. Since the mac does not contain an RS232 port, I am using a usb converter specifically one which provides a virtual com driver for OS X. This driver makes the usb port appear as a serial port and places a device file in the /dev directory. A usb adapter with an FTDI chipset is a perfect example and the one which I am using. As you may or may not know there is not a Apple supplied cocoa classes for accessing the serial port. For a couple of programs I have written, I used the Carbon and C Unix calls to access and use the serial port. However, this is a time consuming task, and would be better suited for my program if I could use or make a cocoa solution. When researching how best to do this in cocoa, I ran across a AMSerialPort. AMSerialPort is a collection of cocoa classes for accessing and doing just about anything with a serial port. It is avaiable here. It also comes with a test application to give you a feel for how to use it. It works really well. The classes also provide a method for accessing a list of available serial ports on the system as well as monitoring the port for incoming data. If you are going to do extensive work in this area The following book provides a good source of information on serial ports. [wordbay]serial relay[/wordbay]