Shop OBEX P1 Docs P2 Docs Learn Events
using serial object — Parallax Forums

using serial object

SiriSiri Posts: 220
edited 2008-03-21 18:43 in Propeller 1
I am very new to spin programing.I have worked with BS2 for some time.
What I am trying to do is to read 3 Bytes of data sent via a serial device to the propeller.
I know the easy way is to use a serial object - using the methods.
I am not exactly sure how to do this using spin code.
I also know you have reference the object.The problem I have is how write that code and how I can put the 3 Bytes in 3 different variables so I can then manupulate each Byte individuallyand also to display the values of each.. Byte as they are recived.

serial data (3 Bytes) -->LCD display ---> put the data in 3 variable --> manupulate data for calculations etc.

I know this is very easy for most of you - but I I do need the help untill I learn spin.

Thank you,

Siri

Comments

  • joe_4664joe_4664 Posts: 2
    edited 2008-03-21 18:09
    Hi, I am doing an engineering project, and I am testing the parallax GPS module with a propeller. I have downloaded the demo program and it is running ok, but in the tv, the info on the gps stays the same even when the GPS recognizes the sattelites. If someone could help me, i would appresiate it. Thanks
  • Mike GreenMike Green Posts: 23,101
    edited 2008-03-21 18:43
    joe_4664,
    Please do not "hijack" someone else's topic. Start your own

    Siri,
    Do you understand anything about the FullDuplexSerial object?
    It is helpful for you to tell us what you do understand, not just what you want to do.

    Have you looked at the comments in the source file for FullDuplexSerial?
    In most of the objects in the library, the source code includes comments that partially explain how to use it.
    Most objects that come with the Propeller Tool also have a sample or demonstration program included.

    You'll need to use the "start" method and probably the "rx" method. "rx" is a function that returns the
    next received character as an 8-bit value. It will wait if there are no characters in the receive buffer.

    You didn't say what kind of LCD you have. If it's a serial LCD, you could use the Debug_LCD object from the
    Propeller Object Exchange. This includes a Simple_Serial object and provides some methods for cursor positioning.
    The Simple_Serial object is similar to the FullDuplexSerial object, but it is unbuffered, is written in Spin with no
    assembly language, and is half duplex only (either sends or receives, but not both at the same time).

    It's very useful for you to look at the existing code like that of the Debug_LCD object.
Sign In or Register to comment.