mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Add Lua API tio.twrite's documentation and example
This commit is contained in:
parent
d5b4e7d881
commit
a19bf0aa44
4 changed files with 44 additions and 6 deletions
22
examples/lua/twrite.lua
Normal file
22
examples/lua/twrite.lua
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
--
|
||||
-- tio.twrite() uses output-mapping, output-delay and input-mode.
|
||||
--
|
||||
-- Input-mode HEX is very slow, so it has limited use.
|
||||
--
|
||||
-- This script sends
|
||||
-- Hello.
|
||||
-- This is Hex mode.
|
||||
-- Bye.
|
||||
--
|
||||
|
||||
tio.set_input_mode(tio.C.IM_NORMAL)
|
||||
tio.twrite("Hello.\r\n")
|
||||
|
||||
tio.set_input_mode(tio.C.IM_HEX)
|
||||
tio.twrite("5468697320697320486578206d6f64652e0d0a") -- "This is Hex mode."
|
||||
|
||||
tio.set_input_mode(tio.C.IM_LINE)
|
||||
tio.twrite("Bye.\r\n")
|
||||
|
||||
tio.set_input_mode(tio.C.IM_NORMAL)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue