turtlebot3-burger_150.png
turtlebot3-waffle-pi_150.png
turtlebot3-arm_150.png
walking-y2_150.png
turbot3-multi_150.png
turbot3-dl-ros1_150.png
turbot3-ai.png
turbot3-dl-ros2_150.png
turbot3-slam_150.png
turbot3-arm_150.png
turtlebot4-lite_150.png
turtlebot4-pro_150.png
turbot4-dl_150.png
turbot4-ai_150.png
aidriving-racebot_150.png
aidriving-autodrive_150.png
turtlebot-arm_150.png
openmanipulator-x_150.png
Home » Farmbot开发入门教程 » farmbot开发入门教程-lua 消息

farmbot开发入门教程-lua 消息

纠错,疑问,交流: 请进入讨论区请点击进入页面,扫码加入微信群或Q群进行交流

获取最新文章: 扫一扫加入“创客智造”公众号

说明:

  • 介绍FarmBot OS 中的消息传递 Lua 函数列表

调试(消息)

  • 发送类型为 的日志debug。
debug("This just happened")

发送消息(类型,消息,渠道?)

  • 向日志频道发送一条消息,并可选择以祝酒词、电子邮件或合成口语的形式发送。
- 第一个必需参数是 log ,它必须是type以下字符串值之一:assertion,,,,,,,,,。busydebugerrorfuninfosuccesswarn
 - 第二个必需参数是消息,它可以是字符串或数字。
 - 第三个参数是可选的,可以是单个字符串或字符串数​​组。字符串必须是以下可用通道之一:toast、email、espeak。


-- Send an error message to the default logs channel:
send_message("error", "Movement failed.")

-- Send a success message to the logs channel and by email:
send_message("success", "You've got mail!", "email")

-- Send a message to the logs channel and multiple other channels:
send_message("info", "All systems running.", {"toast", "espeak"})

-- Compose and send a more complex message:
local position = get_xyz()
local message = "Movement failed. " ..
                "The FarmBot is currently at (" ..
                position.x .. ", " ..
                position.y .. ", " ..
                position.z ..
                ") and is not moving."
send_message("error", message, {"toast", "email"})

吐司(消息,类型?)

  • 将消息作为 toast 通知发送到日志频道。info如果未指定类型,则默认为类型。
-- Send a toast notification:
toast("This is a toast")

wait(1000)

-- Send a toast notification with a different type:
toast("I'll cheers to that", "success")

纠错,疑问,交流: 请进入讨论区请点击进入页面,扫码加入微信群或Q群进行交流

获取最新文章: 扫一扫加入“创客智造”公众号


标签: none