Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Extend grisp_gpio module #1

@Laymer

Description

@Laymer

Quoted from @peerst (thank you so much !) :

From the Erlang level driver standpoint I would add a function grisp_gpio:set_mode/1 which takes atom values:

  • disabled
  • single
  • continuous

In single mode calling the function that gets you the range does:

  1. enable sonar
  2. wait for serial message,
  3. disable sonar
  4. return value

image

possible implementation ?

set_mode(single) ->
     configure(uart_2_txd, output_1, [default]),
     Delay = 10, % 10ms just to make sure
     timer:sleep(50 + Delay),
     Range = pmod_maxsonar:get(),
     configure(uart_2_txd, output_0, [default]).

(PR will to be opened if any success)

  • implement "on/off" feature for Pmod MAXSONAR through GPIO pin configuration
  • Ensure no unexpected latency occurs when sensor is activated/deactivated
  • Ensure switching back to continuous/disabled modes works as expected
  • Document (⚠️⚠️⚠️) sonar triggering method for cross-talk avoidance
  • Provide estimate of minimum necessary delay before triggering each sensor such that cross-talk and total time between first and last measurement are minimal
  • Open Pull Request on the Grisp runtime repository

Metadata

Metadata

Labels

enhancementNew feature or requesthelp wantedExtra attention is needed

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions