7 ms·
If you're interested in seeing a (toy) example project in Nerves, I implemented my own version of an old Finnish reaction speed game [0]. It runs on an RPi0W th
by Ndymium 6y ago
If you're interested in seeing a (toy) example project in Nerves, I implemented my own version of an old Finnish reaction speed game [0]. It runs on an RPi0W that I had lying around and has a live score display over WiFi (using Phoenix LiveView [1]). I've still yet to implement a memory game mode, currently it only has the classic speed game (and pro version where you start at score 100, with the corresponding speed).
You can find the source on GitLab [2] with the interesting part being in the lib folder. The game folder there contains the game part, while web contains the score UI. It's somewhat messy as I was learning both Nerves and LiveView and just trying out different things.
The hardware is still in prototype stage and the LED lights aren't even inside the buttons. I have to say, for me the implementation of the game logic in Elixir was much easier than planning and soldering the electronics! [3]
[0] https://www.youtube.com/watch?v=C8gbcYwmpvU https://www.youtube.com/watch?v=C8gbcYwmpvU
[1] https://github.com/phoenixframework/phoenix_live_view https://github.com/phoenixframework/phoenix_live_view
[2] https://gitlab.com/Nicd/ex_speed_game/ https://gitlab.com/Nicd/ex_speed_game/
[3] https://drive.google.com/file/d/1zc_HlcMH3QfayqxRqWYN9M-duCNgPm1_/view?usp=sharing https://drive.google.com/file/d/1zc_HlcMH3QfayqxRqWYN9M-duCN...