<div dir="ltr"><div>I get make errors with that one<br><br>/usr/local/bin/erlang/lib/gen_serial:../make.sh<br>Recompile: src/gen_serial_test<br>Recompile: src/gen_serial<br>gcc -Wall -O2 -g -ggdb -c -o ../erlang_serial.o ../erlang_serial.c<br>gcc -Wall -O2 -g -ggdb -c -o posix_main.o posix_main.c<br>posix_main.c:84:30: error: use of undeclared identifier 'B460800'<br>        case 460800: tio.c_cflag |= B460800; break;<br>                                    ^<br>posix_main.c:85:30: error: use of undeclared identifier 'B500000'<br>        case 500000: tio.c_cflag |= B500000; break;<br>                                    ^<br>posix_main.c:86:30: error: use of undeclared identifier 'B576000'<br>        case 576000: tio.c_cflag |= B576000; break;<br>                                    ^<br>posix_main.c:87:30: error: use of undeclared identifier 'B921600'<br>        case 921600: tio.c_cflag |= B921600; break;<br>                                    ^<br>posix_main.c:88:31: error: use of undeclared identifier 'B1000000'<br>        case 1000000: tio.c_cflag |= B1000000; break;<br>                                     ^<br>posix_main.c:89:31: error: use of undeclared identifier 'B1152000'<br>        case 1152000: tio.c_cflag |= B1152000; break;<br>                                     ^<br>posix_main.c:90:31: error: use of undeclared identifier 'B1500000'<br>        case 1500000: tio.c_cflag |= B1500000; break;<br>                                     ^<br>posix_main.c:91:31: error: use of undeclared identifier 'B2000000'<br>        case 2000000: tio.c_cflag |= B2000000; break;<br>                                     ^<br>posix_main.c:92:31: error: use of undeclared identifier 'B2500000'<br>        case 2500000: tio.c_cflag |= B2500000; break;<br>                                     ^<br>posix_main.c:93:31: error: use of undeclared identifier 'B3000000'<br>        case 3000000: tio.c_cflag |= B3000000; break;<br>                                     ^<br>posix_main.c:94:31: error: use of undeclared identifier 'B3500000'<br>        case 3500000: tio.c_cflag |= B3500000; break;<br>                                     ^<br>posix_main.c:95:31: error: use of undeclared identifier 'B4000000'<br>        case 4000000: tio.c_cflag |= B4000000; break;<br>                                     ^<br>12 errors generated.<br>make: *** [posix_main.o] Error 1<br>/usr/local/bin/erlang/lib/gen_serial:.<br><br>---<br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 12, 2017 at 1:23 PM, József Bérces <span dir="ltr"><<a href="mailto:jozsef.berces@ericsson.com" target="_blank">jozsef.berces@ericsson.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div link="blue" vlink="purple" lang="EN-US">
<div class="m_-4605432385304923757WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">You can give a try to this one:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><a href="http://github.com/tomszilagyi/gen_serial" target="_blank">http://github.com/tomszilagyi/<wbr>gen_serial</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> <a href="mailto:erlang-questions-bounces@erlang.org" target="_blank">erlang-questions-bounces@<wbr>erlang.org</a> [mailto:<a href="mailto:erlang-questions-bounces@erlang.org" target="_blank">erlang-questions-<wbr>bounces@erlang.org</a>]
<b>On Behalf Of </b>qp<br>
<b>Sent:</b> Sunday, March 12, 2017 17:57<br>
<b>To:</b> Erlang/OTP discussions <<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a>><br>
<b>Subject:</b> [erlang-questions] Reading serial data from a USB Gamepad<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi,<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">I want to read USB data from a Gamepad in Erlang to play a game.<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">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.<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">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 <a href="https://github.com/tonyg/erlang-serial/issues/14" target="_blank">
https://github.com/tonyg/<wbr>erlang-serial/issues/14</a><u></u><u></u></p>
</div>
<p class="MsoNormal">Thank you!<u></u><u></u></p>
</div>
</div></div></div>
</div>

</blockquote></div><br></div>