Shop OBEX P1 Docs P2 Docs Learn Events
New to BS2 and needs help .. — Parallax Forums

New to BS2 and needs help ..

al.mana3ial.mana3i Posts: 7
edited 2010-06-11 12:20 in BASIC Stamp
first of all .. this is the first to program any chip whatsoever .. so everything seems as a puzzle to me [noparse]:([/noparse]

but i hope that i can find what i need here ..

i am using BS2 board which came with "What is a microcontoller" kit .. and i've added the Hitachi compass ..

the code that came with the compass is exactly what i need .. but i need to store the values i get from the compass in a text file or send it to excel .. is that possible ?

if it can be done .. where do i start ?

thank you ..
[noparse]:)[/noparse]

Comments

  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2010-05-25 17:44
    You can add an I2C eeprom (you need to write code to store the data) and a way to retrieve the data and store on a PC using something like Visual Basic and serial output from the stamp.

    Since you are new to this, the easiest method would probably use the Datalogger module to write the data to a USB thumbdrive.

    http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/datalogger/List/0/SortField/4/ProductID/434/Default.aspx
  • Steph LindsaySteph Lindsay Posts: 767
    edited 2010-05-25 17:47
    Hello al.mana3i,

    Welcome to the forums!· If you have done the activities in "What's a Microcontroller?" you are off to a good start. Yes, it is possible to store and export the values you are receiving. I do not have example programs using that particular compass, but there are example programs of data logging and exporting data with other sensors.

    www.parallax.com/go/WAM· - Look under "Stamps in Class Mini Projects" and find the·"Data plotting with Excel" pdf download.

    Smart Sensors and Applications - This is a sequel to "What's a Microcontroller?" and it has datalogging projects too, but using an accelerometer instead of a compass. The principles will be similar. You can download the book, code, and·Excel spreadsheet·from the bottom of the page.

    I hope·gives you some inspiration and examples to start from!

    -Stephanie



    Post Edited (Steph Lindsay (Parallax)) : 5/25/2010 8:54:04 PM GMT
  • electrosyselectrosys Posts: 212
    edited 2010-05-26 00:22
    @al.mana3i

    There is a little free software, that displays the output of a Hitachi HM55B compass, and you can also log all the outputs to file.
    The connections are very easy, just connect·the BS2 board to the serial part of the PC, as you can see at the photo·below.

    Look at my new post at the Sensors >
    http://forums.parallax.com/showthread.php?p=909861

    ethstamp.jpg

    ······················To PCs serial part



    Download the software at: http://www.mollensoft.com/product3.html
  • al.mana3ial.mana3i Posts: 7
    edited 2010-05-26 17:38
    Thank you for your great help

    i will try the solutions you all gave me and i'll see what i'll get

    but, can it be done with the setup i have already ? and using the USB cable no serial ?
  • electrosyselectrosys Posts: 212
    edited 2010-05-26 19:48
    @al.mana3i

    Yes, you can use your USB part·as well. The USB part which·BS2 board is connected, has a virtual Com part, you can easily·find the Com part your BS2 board is connected to. You can do that by connecting the BS2 board to the USB part, start Basic Stamp Editor and·push the
    Identify·function or Ctrl+I , a little widow will be·open,·where you could see the·Com part.
    At the Debug Terminal at the upper left,·at Com Part·you·could also·see the Com part your BS2 is connected to.

    You could also look at Control Panel/System/Hardware/Parts(COM & LPT) here you will see something like this: USB Serial Part(COM5) ,·
    Your USB Com Part·may·be some other number. You·have to·use this·Com part number at the·compass software. (The little graphic compass)

    Good luck·
  • sylvie369sylvie369 Posts: 1,622
    edited 2010-05-26 20:28
    Another alternative is to use PLX_DAQ to send the values directly to Excel. PLX_DAQ is available for download·under Support/Basic Stamp Software·at the Parallax site.
  • al.mana3ial.mana3i Posts: 7
    edited 2010-06-06 10:05
    @sylvie369 I'm using PLX_DAQ the connection seems ok, and i'm getting the right indications (Read, Transit, and Write) .. but nothing is showing in Excel .. and i don't know where is the problem .. where should i start?

    @Ron Czapala i did get the DataLogger .. my question is how to get the feed from the Compass to be written in the Flash memory ?

    thank you for your help ..
  • sylvie369sylvie369 Posts: 1,622
    edited 2010-06-06 10:35
    Did you add the commands to your program to send the data to Excel? You need commands with the PLX_DAQ control directives, such as

    DEBUG "DATA,", DEC Val1, ",", DEC Val2, CR

    If you haven't done so already, you should read the help file that comes with the PLX_DAQ download.
  • al.mana3ial.mana3i Posts: 7
    edited 2010-06-06 15:29
    @sylvie369 i wrote in the main loop of the code

    DEBUG CR

    and i think this is what i need, but when i start PLX_DAQ i'm getting

    Error: Data < ASCII 10 or ASCII 200

    what does that means ?
  • sylvie369sylvie369 Posts: 1,622
    edited 2010-06-06 15:54
    I'm not sure why you would have put "DEBUG CR" into your code. The error message is a pretty general one, I think indicating that it expected a displayable character but is getting something that cannot be displayed.

    But if you want your data to appear in Excel you need to add a valid DATA command (like the one I posted) to your program so that the data are sent to Excel and recognized as data by the macros in Excel that make up PLX_DAQ. Here's an example that I'm using:

    SEROUT 16, 396, [noparse][[/noparse]"DATA, TIME, TIMER,", DEC5 alt, CR]····

    This command sends the current time and current timer reading to two columns in Excel, and then the value of my "alt" variable to the third column. The "DATA" at the start tells the Excel macro to interpret the next things (everything up to the CR) as data to be displayed (TIME and TIMER are special data functions included in PLX_DAQ).

    A more simple example would be

    SEROUT 16, 396, [noparse][[/noparse]"DATA", DEC5 alt, CR]····

    Which would simply put the values of my "alt" variable into the first column of the active Excel spreadsheet. You need something of this sort in your code.
  • al.mana3ial.mana3i Posts: 7
    edited 2010-06-07 16:03
    @sylvie369

    Thank you for your great help, i really appreciate your help.

    i'm frustrated with this code thing, i'm using HM55B Demo Software.bs2 that came with the compass, what modifications should i do to the code in order to get the Excel and PLX_DAQ work?
  • al.mana3ial.mana3i Posts: 7
    edited 2010-06-10 07:00
    help is really needed over here ..

    what should i do ?
  • FranklinFranklin Posts: 4,747
    edited 2010-06-11 02:15
    Somebody said...
    help is really needed over here ..

    what should i do ?
    You should read the posts to the question you asked, try the code, load the programs and then come back, post your code, ask specific questions. That's how it works here.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • al.mana3ial.mana3i Posts: 7
    edited 2010-06-11 12:20
    @Franklin .. thank you ..

    and i've figured it out [noparse]:)[/noparse]

    i don't know how .. but i did it
Sign In or Register to comment.