Serial In Out (SIO) port.
Loads and starts the module.
- Note
- You only need to call this function once.
- Returns
- 1 if the module was started successfully, 0 otherwise.
NIL sio.baud |
( |
NUMBER |
baud | ) |
|
Sets the port baud rate (speed).
- Parameters
-
- Note
- There is no predetermined baud rate, should be changed to match the connected device.
- Returns
- Nothing.
Gets the number of bytes (characters) available for reading from the SIO port.
- Note
- Data are treated who have already arrived and is stored in the reception buffer SIO (Size: 1024 bytes).
- Returns
- The number of bytes in buffer or 0.
Receives an ASCII char.
- Returns
- A number between 0 and 255, or -1 if nothing is in buffer.
NIL sio.write |
( |
NUMBER |
data | ) |
|
Sends an ASCII char.
- Parameters
-
data | The data to send (0-255). |
- Returns
- Nothing.
NIL sio.print |
( |
STRING |
msg | ) |
|
Sends a message.
- Parameters
-
- Returns
- Nothing.
NIL sio.putstring |
( |
STRING |
data, |
|
|
NUMBER |
len |
|
) |
| |
Converts a message to ASCII, and sends it.
- Parameters
-
data | The data to send. |
len | The len of the data to send. |
- Returns
- Nothing.
Closes the port and stops the module.
- Returns
- 1 if the module was stoped successfully, 0 otherwise.