Skip to content

viam-labs/sysfs_hcsr04

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sysfs_hcsr04 modular sensor component

sysfs_hcsr04 is a Viam modular sensor component that provides distance readings from the HCSR04 ultrasonic sensor for boards that can use sysfs to interact with GPIO.

Prerequisites

sudo apt update && sudo apt upgrade -y
sudo apt-get install python3
sudo apt install python3-pip

API

The sysfs_hcsr04 resource fulfills the Viam sensor interface

get_readings()

The get_readings() command takes no arguments, and returns the detected distance in meters (with the key 'distance').

Viam Component Configuration

This component should be configured as type sensor, model viamlabs:sensor:sysfs-hcsr04.

The following attributes may be configured as sysfs_hcsr04 component config attributes.

Example:

{
  "trigger_pin": 32,
  "echo_pin": 30
}

trigger_pin

integer - required

echo_pin

integer - required

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published