Getting started
Overview
The fastest way to try circuitscript is in the Bench. This is an online editor for coding in circuitscript and generating schematics in real-time.
Desktop installation
Besides the Bench, you can also download the circuitscript CLI tool. This tool parses circuitscript files and generates SVG schematics.
The circuitscript
cli tool can be downloaded from npm with the following command:
npm -g install circuitscript
Generating schematics
Save the following code into a file titled example.cst
:
import lib
v3v3 = supply("3V3") # create 3V3 supply
gnd = dgnd() # create gnd
at v3v3
wire down 100 right 100
add res(100)
wire right 100 down 100
add led("green")
wire down 100
to gnd
Run the circuitscript tool with the following command:
circuitscript example.cst output.svg
The following SVG image output.svg
will be generated:
Next steps
You have just written your first circuitscript code! Here's what you can do next:
- Learn more about the motivations and important concepts
- Read more docs or the language reference