I cannot import hc_sr04
in my Toit code. I get the error: Package for prefix 'rmt' not found
. How can I fix the rmt
import issue?
I have installed the hc_sr04
package.
$ toit pkg install github.com/lask/toit-hc-sr04@2.0.0
I try importing it in my code: main.toit
import hc_sr04
main:
print "Start"
When I run it, I get the error: Package for prefix 'rmt' not found
$ toit run --device <UUID> main.toit
<pkg:toit-hc-sr04>/driver.toit:1:8: error: Package for prefix 'rmt' not found
import rmt
^~~
<pkg:toit-hc-sr04>/driver.toit:41:14: error: Unresolved type: 'Channel'
echo_ /rmt.Channel
^~~~~~~
<pkg:toit-hc-sr04>/driver.toit:42:17: error: Unresolved type: 'Channel'
trigger_ /rmt.Channel
^~~~~~~
<pkg:toit-hc-sr04>/driver.toit:45:21: error: Unresolved type: 'Signals'
rmt_signals_ /rmt.Signals
^~~~~~~
<pkg:toit-hc-sr04>/driver.toit:56:20: error: Unresolved identifier: 'Channel'
trigger_ = rmt.Channel trigger --output --idle_level=0
^~~~~~~
<pkg:toit-hc-sr04>/driver.toit:57:17: error: Unresolved identifier: 'Channel'
echo_ = rmt.Channel echo --input
^~~~~~~
<pkg:toit-hc-sr04>/driver.toit:62:24: error: Unresolved identifier: 'Signals'
rmt_signals_ = rmt.Signals 1
^~~~~~~
Compilation failed.
$ toit version
+---------+------------+
| VERSION | DATE |
+---------+------------+
| v1.20.1 | 2022-05-03 |
+---------+------------+
package.yaml
dependencies:
hc_sr04:
url: github.com/lask/toit-hc-sr04
version: ^2.0.0