Shop OBEX P1 Docs P2 Docs Learn Events
Free graphical viewer for the Hitachi HM55B Compass Module — Parallax Forums

Free graphical viewer for the Hitachi HM55B Compass Module

Ken GraceyKen Gracey Posts: 7,389
edited 2008-12-17 17:23 in BASIC Stamp
Hello,

Doug and Andy have really put the new Hitachi HM55B Compass Module to good use in our office. Andy is preparing some educational documentation,·and Doug just·designed a neat·viewer utility for the·sensor using Delphi. It works like this:
  • Program the BASIC Stamp with the HM55B Demo Software.bs2. Or, if you prefer, run the version to calibrate the module as described in the product documentation.
  • Close the DEBUG window to free the serial port.
  • Run HM55B Demo.exe, configure the serial port and click "Run".
attachment.php?attachmentid=37875

We hope you enjoy this neat software. This compass is providing six bits of calibrated resolution.

Ken Gracey
Parallax, Inc.

Comments

  • Stonebridge12Stonebridge12 Posts: 2
    edited 2006-08-29 18:09
    Hi Everyone,

    The graphic tool below is awesome.· I would like to write my own version of the tool in C# and was hoping that someone could point me to the source code (if its available anywhere)...so I can model my new tool similar to this one.· Was this tool written in Delphi ? Just curious...

    Also, i'm not sure if this is the right forum to submit a question concerning the Compass chip, but figure I would try in the hopes that someone might be able to help me (or point me in the right direction).

    When I use the demo source for the Basic Stamp 2 chip, the compass readings fluxuation and never stay still. I can place my breadboard flat on a table (and not touch it) but yet the compass readings are rather jumpy.

    How can I stabilize this ? I'd love to be able to leave it flat and have the readings only jump 1 or 2 degrees in either direction. Right now,· it jumps +/-10 degrees.· Is there any supporting circuitry I can add to minimize this ?

    Thanks in advance for any tips.

    Regards,

    ·Stonebridge
  • terahertzterahertz Posts: 55
    edited 2006-10-08 21:24
    Hi Ken,

    That's a nice piece of software, thank you.

    Is there·ANY way (notice I didn't say easy) to keep the debug window open while using the·viewer utility?·I have the USB BS2.

    I'm using the debug window to control a few things as well as for other sensor output·values.·I could just use the normal HM55B degree outputs in the debug window but I'd love to be able to use the debug window·AND your viewing utility.


    ·
  • Ken GraceyKen Gracey Posts: 7,389
    edited 2006-10-08 22:10
    Terahertz,

    If you could connect a second serial port to the BASIC Stamp, and you replace add SEROUT n9600 commands after each DEBUG command to send the same data to a serial port as you did to the blue DEBUG window, then yes. The USB2SER would be an easy way to achieve this without wiring up a second serial port on the BOE. Another way would be to use our RS-232 AppMod, but your PC will need a second serial port (or you need a USB to serial adapter). I think that some of our boards (like the Professional Development Board) have an extra serial port for this purpose, which could be yet a third solution.

    Hope this helps.

    Ken Gracey
    Parallax, Inc.
  • terahertzterahertz Posts: 55
    edited 2006-10-08 22:52
    Thanks Ken,

    I'll use one of your suggestions, it will be worth it, accurate and easy to read heading data is pretty important to my project.

    I notice you and chris are posting this afternoon. the boss has everyone working on a Sunday during football season.....bummer. [noparse]:)[/noparse]
  • Ken GraceyKen Gracey Posts: 7,389
    edited 2006-10-09 03:20
    Well, he is one of our heros at Parallax you know!

    If Chris and I find free time we're likely to do the same thing with it: pursue our hobbies! And they're all closely related to what we do at Parallax.·I·don't watch football and I don't think Chris does either.

    Or you could say that Chris and I have the same disorder. . .

    Ken Gracey
    Parallax, Inc.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-10-09 03:25
    Ken is correct…I do not watch sports…I spend my free time programming Parallax Microcontrollers and interfacing them to everything.· It so happens I promised our oldest a customized Digital Alarm Clock with dual crescendo alarms, and I intend to deliver.· So I have been sitting at the bench all day working on this and helping others who are working on their projects as well…

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Roger RayRoger Ray Posts: 22
    edited 2007-01-25 16:32
    Are there any C/C++ source code examples for PC programs to display data recieved from a BS2 using serial communications? For example, the source code from the application mentioned above?
  • Ken GraceyKen Gracey Posts: 7,389
    edited 2007-01-25 16:42
    The above example was written in Delphi. I suppose we could open source it, but I'm not sure it would achieve your objectives.

    I'm sure others will point out more useful C/C++ resources for serial port interfacing.

    Ken Gracey
  • aaron87aaron87 Posts: 6
    edited 2007-09-07 08:19
    Could you show the source code for the above example even though its in Delphi?... And is there another way to display data similar to the examlpe other then using Delphi?..... like visual basic?... Thanx in advance
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2007-09-08 16:58
    Hi aaron87, I have an add in for the Visual Basic Express serial template which is at this link.

    http://forums.parallax.com/showthread.php?p=671804

    If VB express is what you are using·and you would like some help PM your email and Ill help set it up.

    You would need to design your own graphics. The screen shot has a Trackbar that rotates the needle through 360 deg to verify the markings on the graphics, this would be removed once you are satisfied with the layout.

    Jeff T.
    470 x 577 - 106K
  • willy1067willy1067 Posts: 107
    edited 2008-12-16 01:32
    Mr. Ken or Chris;

    Is there any way to connect the Hitachi HM55B with the uOLED-96-Pro or uOLED-128-G1;
    and have it display the compass direction as the programs above?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Fernando Gomez


    Never compare yourself with anyone else, there will always be someone bigger·or·smaller·than you.
  • SRLMSRLM Posts: 5,045
    edited 2008-12-16 03:50
    The compass object in the OBEX has a GUI that displays on a TV screen. You could probably get some good ideas from that...
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-12-17 17:23
    Sure there is…of course, with the uOLED128-G1 the simplest method I can think of would be to create multiple images of the dial with the needle facing in all possible directions and then write some code to display the image that matches the current direction. You’re not going to get 360 degrees of resolution from the module, however, to simplify what I am saying, let’s assume you could.

    Step 1 would be to create an image in a paint program of the unit facing 0 degrees (North). Create 359 more images moving the needle 1 degree each time.

    Step 2 would be to download these images to the on-board micro-SD card using the Graphics Composer software.

    Step 3 would be to write your own code (maybe based off the demo code) to send the uOLED-128-G1 a command to display the picture corresponding to the current heading in degrees.

    Now, myself, I would probably focus on 8 or 16 headings and write the code to call up those images. This is a better option from say, a BASIC Stamp module. Trying to redraw the arrow in real-time from a BASIC Stamp Module would be too slow. If you were using a Propeller chip you could do that, though I might still be inclined to simply use pre-designed images. Of course, the real-time updated image would be more fluid.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
Sign In or Register to comment.