[Newbies] Read RasPi GPIO

Ben Coman btc at openInWorld.com
Wed Jan 28 16:35:01 UTC 2015


How about sending #reset to set the stream back to the start ?

Read the paragraph above "lseek" here...
http://falsinsoft.blogspot.com.au/2012/11/access-gpio-from-linux-user-space.html

cheers -ben


On Wed, Jan 28, 2015 at 8:45 PM, Herbert König <herbertkoenig at gmx.net>
wrote:

> Hi,
>
> I can successfully read a GPIO Pin on the RasPi if I do it like:
> |value|
> dataFile ensureOpen.
> value := dataFile upToEnd.
> dataFile close.
> ^value
>
> dataFile is the /sys/class/gpio/gpioxx/value file that exists after
> exporting gpioxx.
>
> Without the reopening and closing of the file I get '' on subsequent reads
> which means that
> StandartFileStream>>basicNext answers nil.
>
> Is there a way to get the values without having to close and reopen the
> file each time?
>
> Thanks
>
> Herbert
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20150129/6e37942b/attachment.htm


More information about the Beginners mailing list