Shop OBEX P1 Docs P2 Docs Learn Events
SERIN from BS2 — Parallax Forums

SERIN from BS2

SteveDSteveD Posts: 64
edited 2005-12-17 01:14 in General Discussion
main:
TX_BYTE theTemp
TX_BYTE setTemp
TX_BYTE tHold
goto main


TX_BYTE:
· ·Flo = 1············ 'alert max 1483
·· ·Pause 1
···· ·· Temp1 = __PARAM1
···· ·· SEROUT Sio,baud,temp1
· ·Flo = 0
RETURN

I can send 3 bytes one right after another from the SX to the stamp using Jon's example code above.· It works great!

The code below does not work for me.· Should I be able to ably the same idea as above and have it work?·

main
·RX_TEMP setAcHi
·RX_TEMP setAcLo
GOTO MAIN

RX_TEMP:
·temp1 = __PARAM1
·· SERIN sio, baud, temp1
RETURN

This format works ok but it seems like the one above should work too.

main:
RX_TEMP
goto main

RX_TEMP:
SERIN sio, baud, setAcHi
SERIN sio, baud, setAcHI
RETURN

Thanks again

Comments

  • BeanBean Posts: 8,129
    edited 2005-12-17 01:03
    Steve,
    In the example that doesn't work, it looks like you setting up to do a SEROUT but then you do a SERIN ?
    For instance why would you do "temp1 = __PARAM1" before a SERIN that is going to change the value of temp1 ?
    I think you want to do this:
    RX_TEMP SUB 0
    
    main:
      setAcHi = RX_TEMP
      setAcLo = RX_TEMP
      GOTO main
    
    RX_TEMP:
      SERIN sio,baud,temp1
      RETURN temp1
    


    Bean.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    "SX-Video OSD module" Now available from Parallax for only·$49.95
    http://www.parallax.com/detail.asp?product_id=30015

    Product web site: www.sxvm.com

    Forget about the past, plan for the future, and live for today.
    ·
  • SteveDSteveD Posts: 64
    edited 2005-12-17 01:14
    That makes a whole lot of since when you put it that way, I will give it a try. Wow I would give anything to be half as sharp as you guys. Believe it or not you guys have brought me along ways.

    THANKS!
Sign In or Register to comment.