Shop OBEX P1 Docs P2 Docs Learn Events
sending a carriage return to data logger? — Parallax Forums

sending a carriage return to data logger?

javelin nubyjavelin nuby Posts: 27
edited 2009-11-24 06:30 in General Discussion
I'm tring to send 16 data points (int.) to the data logger.
I've been able to convert the int. to chr. and log them.
The problem is the next set of data is on the same line as the first.
How do I send a CR to the data logger so that the next set of data is on the next line when I open the file with excel or notepad on my pc?

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-11-23 04:31
    carriage return (ascii) is $0D [noparse][[/noparse]dec 13]
  • javelin nubyjavelin nuby Posts: 27
    edited 2009-11-23 06:29
    so do I just use the shiftout $0D after opening the file for write?
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2009-11-23 08:11
    I think you should write CR + LF.
    If you use the DataloggerSPI class,
    you can use
    myLogger.writeToFile("\r\n",2,0);
    after writing a line of data.

    regards peter
  • javelin nubyjavelin nuby Posts: 27
    edited 2009-11-24 04:03
    Peter, you are the MAN.
    The
    Logger.writeToFile("\r\n",2,0);
    works. Thank you again.
    Can I use the same code if I switch to the DataloggerUART class?
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2009-11-24 06:30
    Yes, except that you must declare uarts
    and pass those to the DataloggerUart constructor.

    All the methods available are in file Datalogger.java


    regards peter
Sign In or Register to comment.