nodesign / weio

weio
http://we-io.net
128 stars 35 forks source link

Added support for HC-SR04 #209

Closed ks156 closed 9 years ago

ks156 commented 9 years ago
HCSR04Read(trigger_pin, echo_pin)

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 commented 9 years ago

Merged. Thanks a lot!

qleroux commented 7 years ago

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