[erlang-questions] Reading serial data from a USB Gamepad

greim greim@REDACTED
Sun Mar 12 19:15:29 CET 2017


Hi,

for me
Erlang-Serial from Tony Garnock-Jones worked well:

https://github.com/tonyg/erlang-serial

tested with some serial hardware, like a embedded lcd terminal and 
minicom on Linux amd64 and Raspberry Pi

Markus


Am 12.03.2017 um 19:00 schrieb qp:
> I get make errors with that one
>
> /usr/local/bin/erlang/lib/gen_serial:../make.sh
> Recompile: src/gen_serial_test
> Recompile: src/gen_serial
> gcc -Wall -O2 -g -ggdb -c -o ../erlang_serial.o ../erlang_serial.c
> gcc -Wall -O2 -g -ggdb -c -o posix_main.o posix_main.c
> posix_main.c:84:30: error: use of undeclared identifier 'B460800'
>         case 460800: tio.c_cflag |= B460800; break;
>                                     ^
> posix_main.c:85:30: error: use of undeclared identifier 'B500000'
>         case 500000: tio.c_cflag |= B500000; break;
>                                     ^
> posix_main.c:86:30: error: use of undeclared identifier 'B576000'
>         case 576000: tio.c_cflag |= B576000; break;
>                                     ^
> posix_main.c:87:30: error: use of undeclared identifier 'B921600'
>         case 921600: tio.c_cflag |= B921600; break;
>                                     ^
> posix_main.c:88:31: error: use of undeclared identifier 'B1000000'
>         case 1000000: tio.c_cflag |= B1000000; break;
>                                      ^
> posix_main.c:89:31: error: use of undeclared identifier 'B1152000'
>         case 1152000: tio.c_cflag |= B1152000; break;
>                                      ^
> posix_main.c:90:31: error: use of undeclared identifier 'B1500000'
>         case 1500000: tio.c_cflag |= B1500000; break;
>                                      ^
> posix_main.c:91:31: error: use of undeclared identifier 'B2000000'
>         case 2000000: tio.c_cflag |= B2000000; break;
>                                      ^
> posix_main.c:92:31: error: use of undeclared identifier 'B2500000'
>         case 2500000: tio.c_cflag |= B2500000; break;
>                                      ^
> posix_main.c:93:31: error: use of undeclared identifier 'B3000000'
>         case 3000000: tio.c_cflag |= B3000000; break;
>                                      ^
> posix_main.c:94:31: error: use of undeclared identifier 'B3500000'
>         case 3500000: tio.c_cflag |= B3500000; break;
>                                      ^
> posix_main.c:95:31: error: use of undeclared identifier 'B4000000'
>         case 4000000: tio.c_cflag |= B4000000; break;
>                                      ^
> 12 errors generated.
> make: *** [posix_main.o] Error 1
> /usr/local/bin/erlang/lib/gen_serial:.
>
> ---
>
>
> On Sun, Mar 12, 2017 at 1:23 PM, József Bérces
> <jozsef.berces@REDACTED <mailto:jozsef.berces@REDACTED>> wrote:
>
>     You can give a try to this one:____
>
>     http://github.com/tomszilagyi/gen_serial
>     <http://github.com/tomszilagyi/gen_serial>____
>
>     __ __
>
>     *From:*erlang-questions-bounces@REDACTED
>     <mailto:erlang-questions-bounces@REDACTED>
>     [mailto:erlang-questions-bounces@REDACTED
>     <mailto:erlang-questions-bounces@REDACTED>] *On Behalf Of *qp
>     *Sent:* Sunday, March 12, 2017 17:57
>     *To:* Erlang/OTP discussions <erlang-questions@REDACTED
>     <mailto:erlang-questions@REDACTED>>
>     *Subject:* [erlang-questions] Reading serial data from a USB Gamepad____
>
>     __ __
>
>     Hi,____
>
>     I want to read USB data from a Gamepad in Erlang to play a game.____
>
>     Programs like JoyToKey and Enjoyable convert Gamepad inputs to
>     keyboard input, but they only send 1 character so using io:read
>     would require an additional "return" press to send the input.____
>
>     Where do I start looking to learn how to read gamepads? I've heard
>     that Erlang ports can be used to interact with the world outside the
>     Erlang shell but I have no idea where to look. I found erlang-serial
>     on Github but had trouble installing it
>     https://github.com/tonyg/erlang-serial/issues/14
>     <https://github.com/tonyg/erlang-serial/issues/14>____
>
>     Thank you!____
>
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>




More information about the erlang-questions mailing list