Question about Propeller to Propeller Communication with Serial Terminal Output

Hello,

I have a very basic setup using a Quickstart board connected to a Propeller Activity Board. (picture below) I was hoping to use the button inputs from the Quickstart board to control "something" (servo, led, number input, anything...) on the Activity Board.

After my first attempt failed, I figured I would start at the basics and just make sure I can communicate something between the 2 boards. First I wrote a program that would simply send a 1 or a 0 from the Quickstart to the Activity Board and blink an LED on the Activity Board (1 on / 0 off, etc). I used the Simple Serial object. After realizing that hole 14 on the Quickstart was not pin 14 on the Propeller.... Success.

I then modified my program to have the Quickstart send a value to the Activity Board, starting at 0 and increment by 1 every second, reaching 5, and starting back at 0. The RX/TX between the boards is handled using the Full Duplex Serial object. And here starts the questioning. When I output the value to the Parallax Serial Terminal, using the Parallax Serial Terminal object, if I output the value as binary, I get 1's and 0's as expected. If I output the value as decimal, I only get 0. Any suggestions why this might be occurring and I would not be seeing a 0 through 5 on the screen? It was my belief that if I have the line of code as PC.dec(value), I would see the decimal value of 'value' on the screen.

Any help and suggestions would be appreciated.

Also, I have seen other posts where someone will put a few lines of code in their post. How do you do that?

Thanks
-Rob

Comments

  • 2 Comments sorted by Date Added Votes
  • dgatelydgately Posts: 999
    edited April 6 Vote Up0Vote Down
    Rob,

    When you send with:
    PC.dec(value)
    
    You are not sending the numeric value of 5, but are sending the ASCII value for the character '5'... You should either convert the ASCII VALUE (hexadecimal 35 or decimal 53) to it's numeric value before displaying it or using it in your Activity board's program as a numeric value.

    See: https://ascii.cl

    Perhaps an over-simplification, but this might work on the Activity board side, though there are perhaps better alternatives (i.e. receiving with value := PC.DecIn()) :
      value := QS.rx()
      value := value -= 0x30  ' ascii values for decimals 0-9 are hexadecimal 0x30-0x39
    
    OR
    
      value := QS.DecIn()
    
    

    Read the code within the Parallax Serial Terminal object for examples...

    dgately
    Livermore, CA (50 miles SE of San Francisco)
  • Use the 'C' button, during post composition for inserting code.

    Example:
    Code goes here
    
    Failure is not an option...it's bundled with the software.
Sign In or Register to comment.