Skip to content

sersend

Anobium edited this page Oct 18, 2020 · 1 revision
SerSend

Syntax:

  SerSend channel, data

Command Availability:

Available on all microcontrollers.

Explanation:

This command will send a byte given by data using the RS232 channel referred to as channel according to the rules set using InitSer.

Example:

  'This program will send a byte using PORTB.2, the value of which
  'depends on whether a button is pressed. This can be used with the example for SerReceive.

  #chip 16F819, 8

  #define RS232Out PORTB.2
  #define RS232In  PORTB.1

  Dir RS232Out Out
  Dir RS232In In

  'Config Software-UART
  #define SendAHigh Set RS232Out ON
  #define SendALow Set RS232Out OFF
  #define RecAHigh Set RS232In ON
  #define RecALow Set RS232In OFF

  Dir Button In

  InitSer 1, r9600, 1+WaitForStart, 8, 1, none, normal
  Do
    If Button = On Then Temp = 100
    If Button = Off Then Temp = 0
    SerSend 1, Temp
    Wait 100 ms
  Loop

For more help, see RS232 Software Overview, InitSer

Clone this wiki locally