Shop OBEX P1 Docs P2 Docs Learn Events
Memory Stick Datalogger Coding Help — Parallax Forums

Memory Stick Datalogger Coding Help

vk1222vk1222 Posts: 6
edited 2012-07-16 15:52 in BASIC Stamp
I am having an issue with my data logging program. I've been trying to cut out parts of the tutorial code (http://www.parallax.com/tabid/768/ProductID/434/Default.aspx) on the site but the coding is a little above my knowledge of BASIC. It seems the tutorial writes 5 random numbers to a text file, but I can't seem to understand what the seed files are or how it checks to see if a USB stick is there. All I really want it to do is take data from the PIR sensor (0 and 1) that is attached to the microcontroller and record all of it into a txt file. I have the PIR sensor connected to servo IN15 and have the datalogger set up as shown in the tutorial, but the code seems to have a lot of unnecessary steps that I can't sort through. Any help will be much appreciated.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-03-28 21:09
    In DataloggerDemo, everything up to the FOR loop that starts at line 119 is initialization for the data logging including opening the file for writing. Everything from line 134 where the comment talks about opening the file for reading up to line 151 where the file is closed deals with reading the data file back as a demonstration. That's not needed. The stuff after line 151 ends the program and includes a subroutine used several times in the program. The DEBUG statements are for understanding the demonstration and can be removed.

    The SEROUT in the FOR loop mentioned puts out a write command to the Datalogger. If you look at the description of the commands in the VDAP Firmware documentation on the Datalogger's webstore page, you'll see that there's a byte count that's part of the command. You have to change the byte count if you change the number of bytes being written. There are some examples in the VDAP documentation.

    I suggest you spend some time getting familiar with Parallax Basic. The Stamp Editor has copies of the "Stamp Basic Syntax and Reference Manual" and the "What's a Microcontroller?" tutorial in its help files. Both are downloadable from Parallax in the Downloads page on their website.
  • LuXo12LuXo12 Posts: 31
    edited 2011-05-18 23:37
    SOLVED
    I now that I'm finished with my classes I was finally able to solved the problem I had with this module. As unbelievable as it may sound, datasheet/manual was not 100% correct, But somehow I managed to get it working
    full files and expanation s are in the included file
    Thanks to everyone that helped me
  • ocean billocean bill Posts: 15
    edited 2012-04-04 15:28
    I am having a problem with the "synchronizing" part of the same code starting at line 70. I have adapted this code (pretty much cut & paste) into a larger process control program that takes temperature readings and logs the data.The problem I have is inconsistency in completing the synchronization. When I start the program, sometimes it syncs within a second or so, other times it waits a minute or more and finally syncs. Sometimes it never syncs. Also, once it syncs, it usually continues to sync right away throughout the program each time it is called to log data. However, occasionally it refuses to sync in the middle of a program cycle.

    Any suggestions?
    Bill
  • GreenTHHNGreenTHHN Posts: 11
    edited 2012-07-16 15:52
    Do you have a capacitor across the power supply to the datalogger module? Mine was behaving strangely until I put a 10uF capacitor on the datalogger module power leads.
Sign In or Register to comment.