Available on: coco

SERIAL WRITE

This command allows you to write one or more bytes, up to a whole string, to the serial port. The simplest syntax is to write a variable to the serial port: in this case, the command will send the exact number of bytes needed to the serial port. To ensure that the actual size is respected, it is possible to indicate the type of data to be considered. Finally, in the case of data types larger than a byte, it is possible to indicate the endianess with which the data will be sent to the serial port.



This instruction allows you to write one or more bytes to the standard serial connection. The instruction will return FALSE if any error occurs.

SYNTAX

 = SERIAL WRITE( variable [AS type] ) [BIG ENDIAN|LITTLE ENDIAN]
 SERIAL WRITE variable [AS type] [BIG ENDIAN|LITTLE ENDIAN]
 = SERIAL WRITE( data )
 = SERIAL WRITE( size )


Legend
  • id : identifier
  • type : datatype
  • v : value
  • "..." : string
  • [...] : optional

EXAMPLE

 result = SERIAL WRITE( 42 AS BYTE )
 result = SERIAL WRITE( "test" )
 result = SERIAL WRITE( 1 )


ABBREVIATION: SErW#

Join BASIC 10Liner Contest with ugBASIC!

An interesting competition is held at the beginning of each year: the BASIC 10Liner Contest. It is possible to use ugBASIC to participate in the next "BASIC10Liner" competition, in the following categories:

  • PUR-120 - A game in 10 lines of max 120 characters (w/abbrev.)
  • EXTREME-256 - A game in 10 lines of max 256 characters (w/abbrev.)
  • SCHAU - Any program in 10 lines of max 256 characters (w/abbrev.)
In order to reduce space you can use this abbreviation for this instruction:

SERIAL WRITE ↔ SErW#

Any problem?

If you have found a problem with this keyword, if you think there is a bug or, more simply, you would like it to be improved, open an issue for this example on GitHub.
Thank you!

open an issue BACK TO KEYWORDS