GithubHelp home page GithubHelp logo

seeed-ardupy-ultrasonic-sensor's Introduction

Seeed ArduPy Ultrasonic Sensor Build Status

Introduction

This Grove - Ultrasonic ranger is a non-contact distance measurement module which works at 40KHz. When we provide a pulse trigger signal with more than 10uS through singal pin, the Grove_Ultrasonic_Ranger will issue 8 cycles of 40kHz cycle level and detect the echo. The pulse width of the echo signal is proportional to the measured distance. Here is the formula: Distance = echo signal high time * Sound speed (340M/S)/2. Grove_Ultrasonic_Ranger's trig and echo singal share 1 SIG pin.

You can get more information in here Grove_Ultrasonic_Ranger.

How to binding with ArduPy

  • Install AIP
  • Build firmware with Seeed ArduPy ultrasonic Sensor
aip install Seeed-Studio/seeed-ardupy-ultrasonic-sensor
aip build
  • Flash new firmware to you ArduPy board
aip flash
#aip flash [path of the new firmware]

For more examples of using AIP, please refer to AIP.

Usage

from arduino import grove_ultra_ranger
import time

ur = grove_ultra_ranger(board.D0)

while True:
    #error:
    #    print ("The distance to obstacles in front is:", ur.cm, "cm", ur.inch, "inches")
    #    the second value (ur.inch) will got zero.
    #reason:
    #    there is a need for some time delay between two adjacent data acquisition
    print ("The distance to obstacles in front is:", ur.cm, " cm")
    #print ("The distance to obstacles in front is:", ur.inch, " inches")
    time.sleep(1)

API Reference

  • cm : Get distance in centimeters
print(ur.cm)
  • inch: Get distance in inches
 print(ur.inch)

This software is written by seeed studio
and is licensed under The MIT License. Check License.txt for more information.

Contributing to this software is warmly welcomed. You can do this basically by
forking, committing modifications and then pulling requests (follow the links above
for operating guide). Adding change log and your contact into file header is encouraged.
Thanks for your contribution.

Seeed Studio is an open hardware facilitation company based in Shenzhen, China.
Benefiting from local manufacture power and convenient global logistic system,
we integrate resources to serve new era of innovation. Seeed also works with
global distributors and partners to push open hardware movement.

Analytics

seeed-ardupy-ultrasonic-sensor's People

Contributors

baorepo avatar lynnl4 avatar pillar1989 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.