From owner-freebsd-arm@FreeBSD.ORG Thu Aug 21 04:51:11 2014 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50244B03 for ; Thu, 21 Aug 2014 04:51:11 +0000 (UTC) Received: from felyko.com (felyko.com [IPv6:2001:470:1:2d5:26:3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id 381F833E5 for ; Thu, 21 Aug 2014 04:51:11 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id 3DB6134A9E4; Wed, 20 Aug 2014 21:51:10 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: HC-SR04 and FreeBSD From: Rui Paulo In-Reply-To: Date: Wed, 20 Aug 2014 21:51:08 -0700 Content-Transfer-Encoding: 7bit Message-Id: <5D802942-2D0F-4324-8212-C2871EEB6327@FreeBSD.org> References: To: Evandro Nunes X-Mailer: Apple Mail (2.1878.6) Cc: freebsd-arm@freebsd.org X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Aug 2014 04:51:11 -0000 On Aug 20, 2014, at 21:48, Evandro Nunes wrote: > hello, > > ive got a ultrasonic sensor model HC-SR04 and a beaglebone black as well as > a cubieboard2, both running FreeBSD 11 built from crochet and wiki > instructions > > thanks to the help from loos@ I could manage to use a 5v relay with BBB > now, how can I read data from HC-SR04 sensor? do we have any library > available? or do we have any GPIO utility to do that? > btw how can I read values from GPIO pins when they are set to input? I wrote a library to handle GPIO on FreeBSD: https://bitbucket.org/rpaulo/libgpio You can also use the gpioctl utility in FreeBSD to read values. -- Rui Paulo