lask / toit-hc-sr04

MIT License
0 stars 2 forks source link

RMT example #9

Open raveesh-me opened 1 year ago

raveesh-me commented 1 year ago

I ran the example as-is to get this error:

➜  toit git:(main) ✗ jag run 04-come_closer/come_closer.toit
Running '04-come_closer/come_closer.toit' on 'bold-town' ...
04-come_closer/come_closer.toit:6:15: error: Argument mismatch for 'Channel'
Too many unnamed arguments provided
Valid named arguments include '--channel_id', '--memory_block_count'
  echo := rmt.Channel
              ^~~~~~~
04-come_closer/come_closer.toit:9:18: error: Argument mismatch for 'Channel'
Too many unnamed arguments provided
Valid named arguments include '--channel_id', '--memory_block_count'
  trigger := rmt.Channel
                 ^~~~~~~
<pkg:toit-hc-sr04>/driver.toit:63:29: error: Unresolved identifier: 'transmit_and_receive'
    received_signals := rmt.transmit_and_receive --rx=echo_ --tx=trigger_ --receive=rmt_signals_ 8
                            ^~~~~~~~~~~~~~~~~~~~
<pkg:toit-hc-sr04>/driver.toit:26:11: error: Class 'Channel' does not have any method 'config_rx'
    echo_.config_rx --idle_threshold=60000 --filter_ticks_thresh=10
          ^~~~~~~~~
<pkg:toit-hc-sr04>/driver.toit:27:14: error: Class 'Channel' does not have any method 'config_tx'
    trigger_.config_tx
             ^~~~~~~~~
<pkg:toit-hc-sr04>/driver.toit:31:18: error: Class 'Signals' does not have any method 'set_signal'
    rmt_signals_.set_signal 0 10 1
                 ^~~~~~~~~~
<pkg:toit-hc-sr04>/driver.toit:33:18: error: Class 'Signals' does not have any method 'set_signal'
    rmt_signals_.set_signal 1 30000 0
                 ^~~~~~~~~~
<pkg:toit-hc-sr04>/driver.toit:34:18: error: Class 'Signals' does not have any method 'set_signal'
    rmt_signals_.set_signal 2 30000 0
                 ^~~~~~~~~~
Compilation failed.
floitsch commented 1 year ago

It looks like you are using an older version of the hc-sr04 package. If possible try to upgrade. You might need to uninstall (jag pkg uninstall hc_sr04) and install (jag pkg install lask/toit-hc-sr04@2) it again.