To create a project, you can run the command
ato create
This command will start by asking for a name to your project. It will then clone the project template on github. Once created on GitHub, paste your repository URL into the command line. Your project should be up and running!
We also added a firmware and mech folder to store 3D designs or firmware associated with your project. Version controlling everything under the same project can be quite handy.
You can create your own project instead of using ato create. Perhaps you will want to setup the project and for it as you create your ato projects. Make sure to follow this project structure:
.
βββ venv -> (active) virtual environment with python^3.11 and atopile installed
βββ your-project
βββ ato.yaml --> definition file for your atopile project
βββ elec --> your virtual environment
β βββ src
β β βββ file.ato
β βββ layout
β βββ default
β βββ kicad-project.kicad_pro
β βββ kicad-project.kicad_pcb
β βββ kicad-project.kicad_sch
β βββ fp-lib-table
βββ ci/cd file --> useful for running jobs automatically on your repo
!!! tip
Our [template project](https://github.com/atopile/project-template/tree/main) contains example code for a github CI workflow to compile your ato files and access your manufacturing files from kicad. Find it [here](https://github.com/atopile/project-template/blob/main/.github/workflows/ci.yml).
The root of an ato project is marked by the presence of an ato.yaml
file.
ato.yaml
contains some project configuration information like the list of things you want to build. It's similar in concept to a package.json in js/node/npm land.
Here's an example:
# this line defines the version of compiler required to compile the project
ato-version: ^0.0.18
# those lines define the elements that will be built by the compiler
builds:
default:
entry: elec/src/your-project.ato:YourProject
# The compiler version follows semantic versioning. The required version to compile your project can be specified using npm's standard.
# Those lines define the package dependencies that your project might have. You can specify the exact package version you want using semantic versioning.
dependencies:
- generics^v1.0.0
!!! tip The compiler version follows sementic versioning. The required version to compile your project can be specified using npm's standard. The same applies to your dependencies.
To test that your project is building, run:
ato build
!!! tip
`ato build` will build the default module and kicad layout. You can specify a specific target with:
`ato build --build [name_of_your_build]`
The build name is defined in the `ato.yaml` file.
You should see a build directory appear in your project structure. This is where atopile places the output files generated from compilation.