duanshangying5102 2019-04-03 08:25
浏览 104

如何结合Gobot使用Orange-Pi零的GPIO

For turning on led lights I want to access the GPIO of the orange-pi zero via gobot I am using gobot since my server from which i want to do this is written in Go. However on the platforms section of gobot it does not mention the orange-pi platform. I already got the gpio working via this library but it is written in Python.

I found an issue discussing the mapping of the device gpio but since I am new to the physical device scene i do not know how i would implement this into gobot

I have this version of the orange pi with the following pin configuration.

The sample code i found for enabling gpio on a raspberry pi is as follows:

    r := raspi.NewAdaptor()
    led := gpio.NewLedDriver(r, "7")

    work := func() {
        gobot.Every(1*time.Second, func() {
            led.Toggle()
        })
    }

    robot := gobot.NewRobot("blinkBot",
        []gobot.Connection{r},
        []gobot.Device{led},
        work,
    )

    robot.Start()

I think the number on this line is relevant for my question led := gpio.NewLedDriver(r, "7")

My final question then is:

How do i use the gpio via gobot on an orange pi zero plus?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作