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

qp quantumpotato@REDACTED
Sun Mar 12 19:00:26 CET 2017


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>
wrote:

> You can give a try to this one:
>
> http://github.com/tomszilagyi/gen_serial
>
>
>
> *From:* 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>
> *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
>
> Thank you!
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170312/3f163874/attachment.htm>


More information about the erlang-questions mailing list