# FlashESP Documentation

Welcome to FlashESP! Here's a guide to help you get started with creating, building, and sharing your ESP projects.

## 1. Getting Started: Your First Project

- After user registration, you can create up to 10 projects.
- To start, click the **Create New Project** button on your dashboard.
- Pick the **Platform** (e.g., ESP32, ESP8266, Arduino AVR), **SDK Version**, and the specific **Board** you are using.
- Once the project is created, you can set up **Board Configuration** with options appropriate for your chosen board.

## 2. Managing Source Files

- Once your project is created, you can **create a new file** directly in the editor or **upload your own** source files. As for now, you can only upload files supported by the Arduino IDE.
- You can create a file named `libraries_lock.json` to specify exact library versions for reproducible builds. For example:

  ```json
  {
    "libraries": [
      {
        "name": "ArduinoJson",
        "version": "6.21.3"
      },
      {
        "name": "PubSubClient",
        "version": "2.8.0"
      },
      {
        "name": "DHT sensor library",
        "version": "1.4.4"
      }
    ]
  }
  ```

  **When using any external library, it must be specified within this file. Otherwise, the system won't know to include it during compilation.**
- You have full control to **delete and modify** your project files at any time.
- It's recommended to create a `README.md` file in Markdown format to document your project.

## 3. Building Your Project

- When you're ready, click the **Start New Build** button to compile your project.
- You can monitor the compilation process by clicking on the build and following the **live logs**.
- Once the build is successful, you can download all created artifacts.
- You can also delete old or unnecessary builds to keep your project clean.

## 4. Flashing Your Device

- When a build is successful, the **Flash** button will be available.
- If you want to see the terminal logs from your device, click on **Flash**, open the **Logs** tab, and reset your device. The logs will appear in the terminal.
- Arduino AVR boards that use the Uno bootloader (Uno, Nano, Pro Mini and their clones) are flashed the same way: click **Flash Device** and choose the board's serial port. Boards with the older 57600 baud bootloader are detected automatically.
- If your board does not show up in the list of ports, click **Board not listed?** for a checklist and the driver downloads for common USB chips (CH340, CP2102, FTDI).

## 5. Serial Monitor

- Click **Serial Monitor** in the sidebar to open it under any page of the dashboard. Click **Connect** and choose the board's serial port to see everything your sketch prints with `Serial.print()`.
- The first list in the monitor shows the port in use. It holds the boards you have chosen before; **Choose a port...** opens the browser's list of all connected boards.
- The speed has to match the one in your sketch: with `Serial.begin(9600)` choose **9600 baud**. A wrong speed shows up as unreadable characters.
- Type in the field at the bottom and press **Enter** to send a message to the board. The list next to it sets what is added at the end of the message (a new line by default).
- Connecting restarts most Arduino boards, so you see the output from the start of the sketch. **Restart board** does the same later, like the reset button on the board.
- The monitor and flashing share the port. While an Arduino AVR board is flashed the monitor pauses and reconnects by itself. Before an ESP board is flashed it disconnects, and you connect again when flashing is done.
- A port you have chosen is used again without asking, for flashing too, for as long as the board stays plugged in. To use another board, pick it from the port list.
- The monitor needs Web Serial: use Google Chrome or Microsoft Edge on a computer.

## 6. Project Management & Sharing

- You can add a **description and tags** to your project to keep it organized.
- Change the visibility to **Unlisted** to share your project only with people who have the direct link.
- Set the visibility to **Public** to make it discoverable in the public **Explorer**.
