Shop OBEX P1 Docs P2 Docs Learn Events
trouble sending data with UART VP — Parallax Forums

trouble sending data with UART VP

NorvinNorvin Posts: 4
edited 2004-11-01 16:35 in General Discussion
Hello,

I'm having trouble getting my data to show up in the terminal window correctly.· I'm trying to send SRF04 distances through the·UART VP but the output on the window is not numerical data.· Any help here would be much appreciated.

·

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2004-10-29 15:28
    post code please.

    regards peter
  • JavalinJavalin Posts: 892
    edited 2004-10-30 13:50
    Sounds like you need to use the stringbuffer object/class to change an int into a string to send via a uart, i.e.

    // ie

    static Uart LCD = new Uart(Uart.dirTransmit,CPU.pin13,Uart.invert,Uart.speed9600,Uart.stop1);
    static StringBuffer bufferOut = new StringBuffer(100);
    static int distance = 20; // for example

    ...........

    bufferOut.clear();
    bufferOut.append("distance is ");
    bufferOut.append(distance);

    LCD.sendString(bufferOut.toString());
  • NorvinNorvin Posts: 4
    edited 2004-11-01 16:35
    Thanks alot javelin that worked for me.
Sign In or Register to comment.