Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for HC-SR04 #209

Merged
merged 2 commits into from
Apr 28, 2015
Merged

Added support for HC-SR04 #209

merged 2 commits into from
Apr 28, 2015

Conversation

ks156
Copy link
Contributor

@ks156 ks156 commented Apr 28, 2015

  • Added a function in IoTPy
  • Added the support in weioLib (weioIO.py and weioGpio.py). Usage :
HCSR04Read(trigger_pin, echo_pin)
  • New version of the firmware that support this sensor
  • Changed the DHTxx SFP id from 200 to 100 to leave some room for other devices

Example code:

from weioLib.weio import *

def setup():
    attach.process(myProcess)

def myProcess():
    while True:
        print HCSR04Read(0, 1) # trigger pin, echo pin
        delay(200)

This function return the distance in centimeters.

drasko added a commit that referenced this pull request Apr 28, 2015
Added support for HC-SR04
@drasko drasko merged commit 792a8b3 into nodesign:next Apr 28, 2015
@drasko
Copy link
Contributor

drasko commented Apr 28, 2015

Merged. Thanks a lot!

@qleroux
Copy link

qleroux commented Mar 11, 2017

Hi !
Is there a way to call HCSR04 from JS ? Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants