Menu

rs232 output problem

Help
2009-05-01
2013-05-30
  • Nobody/Anonymous

    I need this :
    cam = 2 'this is a number set by a input pin status can be 2 or 4
    check = 18 + cam
    Xmit_RS232 (check)

    to equal this output: Xmit_Print ("20") 'this works fine

    but I get weird symbols from the first one instead, there must be something
    wrong with my wording?

     
    • kent_twt4

      kent_twt4 - 2009-05-02

      Well, when the alternate soft usart routine was written, there was a poor choice in naming the subs by yours truly ;-).  If you follow the alternate soft usart example in the contributors forum, the way to send out a word variable from the ReadAD10 was:

      Bin2ascii ReadAD10(AN1)

      so for your case;

      Bin2ascii (check)

      Not so intuitive.  Having the Bin2ascii sub in your program, and using the above syntax should do it.  The Bin2ascii sub calls the Xmit_RS232 to send out each digit (i.e. byte size ascii representation) of a variable over the TX line.  If you are just sending out a byte variable, then the SERDECMIL, and SERMIL parts of the Bin2ascii sub can be commented out accordingly.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.