[erlang-questions] [ANN] wpi - Controlling the Raspberry Pi using Erlang

Tony Rogvall tony@REDACTED
Tue Oct 9 09:28:24 CEST 2012


Thanks!

Note that serialGetchar (wiringSerial) will block for (up to) 10s if no character is available.
(From function header documentation)

And this fact (wiringSerial.c:95)

    options.c_cc [VMIN]  =   0 ;
    options.c_cc [VTIME] = 100 ;	// Ten seconds (100 deciseconds)

The effect is that the emulator will be blocked and no other processes may run (for up to 10 s)!  
(unless there are more cores than one (online))
You may want to use driver_select. Should probably set the VTIME=0 to be sure.

A little plug:
There is a project using threads to get some exotic uart features, a bit heavy, but is working (even on windows!)
(Still lack documentation but has a simple api and is simple to use, nice packeting options for example)
https://github.com/tonyrog/uart

/Tony





On 8 okt 2012, at 22:27, Klas Johansson <klas.johansson@REDACTED> wrote:

> Hi,
> 
> Are you interested in letting Erlang control a Raspberry Pi [1]? If so
> you might be interested in `wpi' which is an Erlang wrapper around the
> WiringPi library (by Gordon Henderson) which is a Raspberry Pi dialect
> of the Wiring library which you may have experienced for Arduino. wpi
> makes it possible to read from and write to GPIO pins, write to LCDs,
> shift bits in and out and control other devices over serial interfaces
> or SPI and all this from a Raspberry Pi running Erlang.
> 
>    https://github.com/klajo/wpi
> 
> Contributions are more than welcome. Thanks to David Haglund who
> contributed the SPI bus and serial interface parts.
> 
> Best Regards,
> Klas
> 
> [1] http://www.raspberrypi.org/faqs
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

"Installing applications can lead to corruption over time. Applications gradually write over each other's libraries, partial upgrades occur, user and system errors happen, and minute changes may be unnoticeable and difficult to fix"



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20121009/8f82a6e4/attachment.htm>


More information about the erlang-questions mailing list