Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/logotip4ik/csad2425ki405kostyukbogdan14


https://github.com/logotip4ik/csad2425ki405kostyukbogdan14

Last synced: 2 days ago
JSON representation

Awesome Lists containing this project

README

        

# csad2425ki405kostyukbogdan14

### Details about repo

This repository created for course "Computer systems automated design" of "Lviv Polytechnic National University".

### Task details

Create a rock, paper, scissors game.

### Student details

| Student number | Task | Config format|
| ------ | ---- | ------------ |
| 14 | rock paper scissors | JSON |

### Technical details

- Programming language: C++
- Hardware: ESP32

## Task 2

### Get Up and Running

To upload code into the board:

1. Install [PlatformIO](https://platformio.org/)
2. Connect your ESP32
3. Run `pio run -t upload`, this will build and upload code to the board.

PlatformIO (`pio`) is smart enough to auto-detect board connection port. If you also need to view
the logs, add `-t monitor` to the upload command (`pio run -t upload -t monitor`). This will build
the project, upload the code and start monitoring serial port.

Then, to actually try the communication:

1. Connect to `ESP32` WiFi (password should be `12341234`. You can change both of WiFi name and
password in `src/main.cpp`)
2. Open `http://192.168.1.1` in your browser
3. Now, you are able to update the counter which stays in sync with server

### Details

Server is the source of truth. Client sends request to the server to update `State` counter and
returns html with new state, which client inserts into the page.

### Encountered issues

1. You may need to install driver for ESP32 usb from [Silicon Labs](https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers?tab=downloads)
2. Web server was crashing itself when sending big payloads (like `htmx`). To fix this, i used
chunked response.

## Task 3

To setup view [Task 2 Get Up and Running](#get-up-and-running)

### Details

Now it's working game. We provide 3 game modes for the user:

1. Human vs. Human
2. Human vs. AI
3. AI vs. AI

Everything is managed by the server. HTML is used only to display options and results.