Microcontrollers & Logic: Difference between revisions
written a lot |
→Equal: spacing |
||
| (38 intermediate revisions by 2 users not shown) | |||
| Line 5: | Line 5: | ||
=== Creating a Microcontroller === | === Creating a Microcontroller === | ||
[[File:MC tab location.png|left|thumb| | [[File:MC tab location.png|left|thumb|439x439px|MC Tab Location]] | ||
==== Properties Initial setup. ==== | ==== Properties Initial setup. ==== | ||
[[File:Name and parts menu example.png|thumb| | [[File:Name and parts menu example.png|thumb|298x298px|Parts Menu Example]] | ||
Step 1 in any MC is creating one. At the top of your vehicle editor you will see 8 tabs, you want to select the final one labelled "Microcontroller Editor". Once in this mode, it will default you to the "Design" settings and you will see 3 tabs; "Properties", "Logic" and "Symbol". | Step 1 in any MC is creating one. At the top of your vehicle editor you will see 8 tabs, you want to select the final one labelled "Microcontroller Editor". Once in this mode, it will default you to the "Design" settings and you will see 3 tabs; "Properties", "Logic" and "Symbol". | ||
* Properties tab is where you will define a name and description for your microcontroller; this is what it will appear as in your parts menu. You also will have the opportunity to define the size of your microcontroller; with the smallest scale being <code>1 Block × 1 Block × 1 Block</code> and the maximum being <code>6 Block × 6 Block × 1 Block</code>. It is important to select the correct size however this can be edited at any time, you can make it as large as possible and condense later. | *Properties tab is where you will define a name and description for your microcontroller; this is what it will appear as in your parts menu. You also will have the opportunity to define the size of your microcontroller; with the smallest scale being <code>1 Block × 1 Block × 1 Block</code> and the maximum being <code>6 Block × 6 Block × 1 Block</code>. It is important to select the correct size however this can be edited at any time, you can make it as large as possible and condense later. | ||
* Logic tab is where you will set the various logic nodes. | *Logic tab is where you will set the various logic nodes. | ||
* Symbol Tab is where you will setup the symbol that will appear in the parts menu for your microcontroller. This is done by toggling each pixel from dark grey to light grey in a <code>16 × 16</code> grid. | *Symbol Tab is where you will setup the symbol that will appear in the parts menu for your microcontroller. This is done by toggling each pixel from dark grey to light grey in a <code>16 × 16</code> grid. | ||
==== Logic Nodes ==== | ==== Logic Nodes ==== | ||
Step 2 in creating a microcontroller is assigning your Logic Nodes. To do this, go to the "Logic" tab in the microcontroller designer and select the large blue addition symbol which is labelled "Add Node" when you hover your mouse over it. Once done, you will see a red <code>on/off</code> <code>input</code> node appear in the list, as well as a red circle appear on the microcontroller in the bottom left slot. From here, we can choose | Step 2 in creating a microcontroller is assigning your Logic Nodes. To do this, go to the "Logic" tab in the microcontroller designer and select the large blue addition symbol which is labelled "Add Node" when you hover your mouse over it. Once done, you will see a red <code>on/off</code> <code>input</code> node appear in the list, as well as a red circle appear on the microcontroller in the bottom left slot. From here, we can choose the kind of node, and whether or not we want the node to be an input variable (going into the microcontroller) or an output variable (leaving the microcontroller), here you can also set a name and a description for your logic nodes. The different forms of logic nodes are;[[File:Node layering demonstration.gif|thumb|298x298px|Node Layering]] | ||
*<code>on/off</code> - Alternatively referred to as Boolean nodes; this is your basic binary On or Off logic transfer node. ''The default colouring is Red'' | |||
*<code>number</code> - This node will transfer a numerical value. ''The default colouring is Green.'' | |||
*<code>composite</code> - This is your composite channel node; containing 32 channels for both <code>on/off</code> and/or <code>number</code> data, Meaning it is possible to pass 64 different channels of information through this single node, provided 32 different <code>on/off</code> values and 32 different <code>number</code> values. ''The default colouring is Purple.'' | |||
*<code>video</code> - This node will allow you to output a video to various components (e.g. monitor, HUD, etc) or input from a Camera component to be modified (e.g. adding a sight or data to a HUD). ''The default colouring is Light Blue.'' | |||
*<code>audio</code> - This node will allow you to input and manipulate audio from microphones. ''The default colouring is Khaki Green.'' | |||
Following game version <code>v1.15.10 - The Microcontroller Layers Update</code><ref>''Steam Announcement Page for update.''https://store.steampowered.com/news/app/573090/view/507351614918492485</ref> in January of 2026 you are now able to layer logic nodes over one-another allowing for more compact microcontrollers. | |||
* | == Logic Editor == | ||
The Final step is going into the logic editor; represented at the top of the Microcontroller editor by the Lightbulb. This will bring you to a large grid with its own toolbar and parts menu that includes various logic gates for various different functions; in here you will also see the nodes you have selected in the "Design" tab as boxes with node input or output anchors, that share the same name and description as given in the Logic Design tab. Now you can start making your microcontroller's logic. | |||
==== Logic Gates ==== | |||
Once you have successfully set up your logic nodes; you can begin to learn what the various logic gates do. To understand this, we will need to first understand what a truth table is; a Truth Table<ref>''Wikipedia Page for Truth tables'' https://en.wikipedia.org/wiki/Truth_table</ref> is used to map out various logic gate or mathematical outcomes in a given system. (''see example of an AND gate truth table below''). In this page; we will be using <code>A, B, C</code> as inputs variable, and <code>Q</code> as output variable. | |||
{| class="wikitable mw-collapsible mw-collapsed" | |||
! colspan="3" |AND Gate Example | |||
|- | |||
!A | |||
!B | |||
!Q | |||
|- | |||
|0 | |||
|0 | |||
|0 | |||
|- | |||
|1 | |||
|0 | |||
|0 | |||
|- | |||
|0 | |||
|1 | |||
|0 | |||
|- | |||
|1 | |||
|1 | |||
|1 | |||
|} | |||
=== "Arithmetic" gates === | |||
[[File:arithmetic_logic_gates.png|frameless|682x682px]] | |||
This section is for the "Arithmetic" gates tab in the Parts Menu. | |||
===== Abs ===== | |||
[[File:ABS_logic_symbol.png|frameless|35x35px]] "''Outputs the absolute value of the input value (negative numbers become positive).''" | |||
Useful if you need to know "how far is x from 0", or when needing to guarantee that something is a positive number. | |||
<code>in = 1 out = 1 | |||
in = -1 out = 1 | |||
in = -15 out = 15 | |||
</code> | |||
===== Add ===== | |||
[[File:ADD_logic_symbol.png|frameless|35x35px]] "''Adds the two input values together and outputs the result.''" | |||
Simply adds the two inputs together | |||
<code>x=1 y=1, out=2 | |||
x=10 y=-5, out=5 | |||
</code> | |||
===== Subtract ===== | |||
[[File:SUBTRACT_logic_symbol.png|frameless|35x35px]] "''Subtracts the second input from the first input and outputs the result.''" | |||
Subtracts the second number from the first, can also be understood as an Add block except the second input is inverted | |||
<code>x=2 y=1, out=1 | |||
x=10 y=5, out=5 | |||
</code> | |||
===== Multiply ===== | |||
[[File:MULTIPLY_logic_symbol.png|frameless|35x35px]] "''Multiplies the two input values and outputs the result.''" | |||
Multiplies the two inputs together | |||
<code>x=2 y=2, out=4 | |||
x=10 y=5, out=50 | |||
</code> | |||
===== Divide ===== | |||
[[File:DIVIDE_logic_symbol.png|frameless|35x35px]] "''Divides the first input by the second and outputs the result.''" | |||
Divides the first number by the second number.<br> | |||
If dividing by 0, it will output 0 on the Number output and output True on the Boolean output instead. | |||
<code>x=4 y=2, out=2 | |||
x=10 y=2, out=5 | |||
</code> | |||
===== Clamp ===== | |||
[[File:CLAMP_logic_symbol.png|frameless|35x35px]] "''Clamps the input value between a set min and max and outputs the result.''" | |||
The input number will be clamped to always be within the range set in the properties | |||
<code>x=4 range=(-1, 1), out=1 | |||
x=4 range=(-5, 5), out=4 | |||
x=-10 range=(-5, 5), out=-5 | |||
</code> | |||
===== Equal ===== | |||
[[File:EQUAL_logic_symbol.png|frameless|35x35px]] "''Compares whether or not two numbers are equal within a set accuracy.''" | |||
Checks if two numbers are equal, outputs true if they are.<br> | |||
The "Epsilon" setting within it sets the threshold for how close numbers have to be to be considered equal. | |||
<code>x=4 y=4 epsilon=0.1, output=true | |||
x=4 y=3 epsilon=0.1, output=false | |||
x=4 y=3 epsilon=1, output=true | |||
</code> | |||
===== Constant Number ===== | |||
[[File:CONSTANT_NUMBER_logic_symbol.png|frameless|35x35px]] "''Outputs a constant number that is set on the properties panel.''" | |||
Always output the number set in the properties. | |||
===== Delta ===== | |||
[[File:DELTA_logic_symbol.png|frameless|35x35px]] "''Outputs the difference between the input and the input from the previous tick.'" | |||
Measures the rate of change of a number, by subtracting the value from the previous tick from the current value.<br> | |||
Can be used to measure rates such as rate of fuel consumption by inputting fuel level. | |||
===== Modulo (fmod) ===== | |||
[[File:DELTA_logic_symbol.png|frameless|35x35px]] "''Outputs the [https://en.wikipedia.org/wiki/Modulo modulo] of input A by input B.'" | |||
Outputs the remainder from diving input one by input two. | |||
<code>x=3 y=2, output=1 | |||
x=5 y=2 epsilon=0.1, output=1 | |||
x=12 y=5 epsilon=1, output=2 | |||
</code> | |||
===== Arithmetic Function (<code>x</code> & <code>x,y,z</code> & <code>x,y,z,w,a,b,c,d</code>) ===== | |||
[[File:FUNCTION_logic_symbol.png|frameless|35x35px]] "''Evaluates a mathematical expression with up to (1 / 3 / 8) input variables and outputs the result.'" | |||
The Arithmetic Function block can perform arithmetic operations on its inputs using the operators: | |||
<code>+</code> - Addition | |||
<code>-</code> - Subtraction | |||
<code>*</code> - Multiplication | |||
<code>/</code> - Division | |||
<code>%</code> - Modulo | |||
<code>^</code> - Power | |||
It also has the constants: | |||
<code>pi</code> - The value of Pi | |||
<code>pi2</code> - The value of Pi multiplied by 2 | |||
And the [https://en.wikipedia.org/wiki/Trigonometric_functions Trigonometric Functions]: | |||
<code>sin(x)</code> - Outputs the Sine of x | |||
<code>cos(x)</code> - Outputs the Cosine of x | |||
<code>tan(x)</code> - Outputs the Tangent of x | |||
<code>asin(x)</code> - Outputs the Arcsine of x | |||
<code>acos(x)</code> - Outputs the Arccosine of x | |||
<code>atan(x)</code> - Outputs the Arctangent of x | |||
<code>atan2(x, y)</code> - | |||
It also has functions for: | |||
<code>max(x,y)</code> - Outputs the higher value | |||
<code>min(x,y)</code> - Outputs the lower value | |||
<code>ceil(x)</code> - Rounds x up | |||
<code>floor(x)</code> - Rounds x down | |||
<code>round(x)</code> - Rounds x (normally) | |||
<code>abs(x)</code> - Outputs the absolute value of x | |||
<code>sgn(x)</code> - Outputs the sign of x (1 if positive or x=0) (-1 if negative) | |||
<code>sqrt(x)</code> - Outputs the square root of x | |||
<code>len(x,y)</code> - Outputs the length of the vector (x,y) | |||
<code>len2(x,y)</code> - Outputs the length of the vector (x,y) without square rooting the result | |||
<code>lerp(x,y,z)</code> - Linearly interpolates from x to y using z as the position | |||
<code>clamp(x,y,z)</code> - Clamps x to be within y and z | |||
=== "Logical" gates === | |||
[[File:Logical_tab_-_logic_nodes.png|frameless|682x682px]] | |||
This section is for the "Logical" gates tab in the Parts Menu. | |||
===== AND Gate ===== | |||
[[File:AND_Gate_Symbol.png|frameless|35x35px]] "''Outputs the logical AND of its two input signals.''" | |||
This logic gate will only output a signal if both inputs are toggled on. | |||
[[File:AND Gate gif.gif|none|thumb|231x231px|AND Gate Demonstration]] | |||
{| class="wikitable mw-collapsible mw-collapsed" | |||
! colspan="3" |Truth Table | |||
|- | |||
!A | |||
!B | |||
!Q | |||
|- | |||
|0 | |||
|0 | |||
|0 | |||
|- | |||
|0 | |||
|1 | |||
|0 | |||
|- | |||
|1 | |||
|0 | |||
|0 | |||
|- | |||
|1 | |||
|1 | |||
|1 | |||
|} | |||
===== NAND Gate ===== | |||
[[File:NAND Gate Symbol.png|frameless|35x35px]] "''Outputs the logical NAND of its two input signals.''" | |||
This will output a signal if either of the signals are toggled on; but will output no signal if both inputs are toggled on. | |||
[[File:NAND Gate gif.gif|none|thumb|233x233px|NAND Gate Demonstration]] | |||
{| class="wikitable mw-collapsible mw-collapsed" | |||
! colspan="3" |Truth Table | |||
|- | |||
!A | |||
!B | |||
!Q | |||
|- | |||
|0 | |||
|0 | |||
|1 | |||
|- | |||
|0 | |||
|1 | |||
|1 | |||
|- | |||
|1 | |||
|0 | |||
|1 | |||
|- | |||
|1 | |||
|1 | |||
|0 | |||
|} | |||
===== OR Gate ===== | |||
[[File:OR Gate Symbol.png|frameless|35x35px]] "''Outputs the logical OR of its two input signals.''" | |||
This will output an On signal if either of the 2 inputs are toggled on. This is the most common way of combining 2 <code>on/off</code> signals. | |||
[[File:OR gate gif.gif|none|thumb|234x234px|OR Gate Demonstration]] | |||
{| class="wikitable mw-collapsible mw-collapsed" | |||
! colspan="3" |Truth Table | |||
|- | |||
!A | |||
!B | |||
!Q | |||
|- | |||
|0 | |||
|0 | |||
|0 | |||
|- | |||
|1 | |||
|0 | |||
|1 | |||
|- | |||
|0 | |||
|1 | |||
|1 | |||
|- | |||
|1 | |||
|1 | |||
|1 | |||
|} | |||
===== NOR Gate ===== | |||
[[File:NOR Gate Symbol.png|frameless|35x35px]] "''Outputs the logical NOR of its two input signals.''" | |||
This gate will only output a signal if neither input is toggled on. If either or both inputs are toggled on, the gate will not output any signal. | |||
[[File:NOR Gate Gif.gif|none|thumb|234x234px|NOR Gate Demonstration]] | |||
{| class="wikitable mw-collapsible mw-collapsed" | |||
! colspan="3" |Truth Table | |||
|- | |||
!A | |||
!B | |||
!Q | |||
|- | |||
|0 | |||
|0 | |||
|1 | |||
|- | |||
|0 | |||
|1 | |||
|0 | |||
|- | |||
|1 | |||
|0 | |||
|0 | |||
|- | |||
|1 | |||
|1 | |||
|0 | |||
|} | |||
===== XOR Gate ===== | |||
[[File:XOR Gate Symbol.png|frameless|35x35px]] "''Outputs the Logical XOR of its two input signals.''" | |||
This gate outputs a signal if only output a signal if either A or B are toggled on; but wont output a signal if both or neither are enabled. | |||
[[File:XOR Gate Gif.gif|none|thumb|234x234px|XOR Gate Demonstration]] | |||
{| class="wikitable mw-collapsible mw-collapsed" | |||
! colspan="3" |Truth Table | |||
|- | |||
!A | |||
!B | |||
!Q | |||
|- | |||
|0 | |||
|0 | |||
|0 | |||
|- | |||
|0 | |||
|1 | |||
|1 | |||
|- | |||
|1 | |||
|0 | |||
|1 | |||
|- | |||
|1 | |||
|1 | |||
|0 | |||
|} | |||
===== NOT Gate ===== | |||
[[File:NOT Gate Symbol.png|frameless|35x35px]] "''Outputs the logical NOT of its input signal''." | |||
This will output the opposing signal inputted; On becomes Off, Off becomes On. | |||
[[File:NOT Gate Gif.gif|none|thumb|234x234px|NOT Gate Demonstration]] | |||
{| class="wikitable mw-collapsible mw-collapsed" | |||
! colspan="2" |Truth Table | |||
|- | |||
!A | |||
!Q | |||
|- | |||
|1 | |||
|0 | |||
|- | |||
|0 | |||
|1 | |||
|} | |||
===== Pulse (Toggle to Push) ===== | |||
[[File:Pulse Symbol.png|frameless|36x36px]] "''A switch that outputs a single tick pulse. It can be configured to pulse when being switched from off to on (default), on to off, or always when the input signa''-''l changes.''" | |||
===== Push To Toggle ===== | |||
[[File:Push to Toggle.png|frameless|35x35px]] "''An on/off switch that is toggled every time a new on signal is sent to its input.''" | |||
===== JK Flip Flop ===== | |||
[[File:JK FlipFlop Symbol.png|frameless|35x35px]] "''An JK Flip flop that can be set and reset using two on/off inputs.''" | |||
===== SR Latch ===== | |||
[[File:SR Latch Symbol.png|frameless|35x35px]] "''An SR latch that can be set and reset using two on/off inputs.''" | |||
===== Constant On Signal ===== | |||
[[File:Constant On Signal Symbol.png|frameless|35x35px]] "''Outputs a constant on signal.''" | |||
This will output a constant on signal. | |||
[[File:Constant On gif.gif|none|thumb|234x234px|Constant On Demonstration]] | |||
{| class="wikitable mw-collapsible mw-collapsed" | |||
!Truth Table | |||
|- | |||
!Q | |||
|- | |||
|1 | |||
|} | |||
===== Boolean Functions (Both <code>x,y,z,w</code> & <code>x,y,z,w,a,b,c,d</code>) ===== | |||
[[File:FUNCTION logic symbol.png|frameless|35x35px]] "''Evaluates a logical expression with up to <code>4 to 8</code> input variables and outputs the result.''" | |||
The Boolean Functions block can perform any number and combination of AND, OR, XOR, and NOT operations on its boolean inputs using the operators: | |||
<code>&</code> - AND | |||
<code>|</code> - OR | |||
<code>^</code> - XOR | |||
<code>!</code> - NOT | |||
=== "Control" gates === | |||
[[File:Control_tab_-_logic_nodes.png|frameless|682x682px]] | |||
This section is for the "Control" nodes tab in the Parts Menu. | |||
===== Blinker ===== | |||
[[File:BLINKER_logic_symbol.png|frameless|35x35px]] "''Outputs a value that blinks on and off at a set rate.''" | |||
===== Capacitor ===== | |||
[[File:CAPACITOR_logic_symbol.png|frameless|35x35px]] "''Charges up when receiving an on signal, then discharges over a period of time.''" | |||
===== Greater than ===== | |||
[[File:GREATER_THAN_logic_symbol.png|frameless|35x35px]] "''Outputs an on signal if the first input is greater than the second.''" | |||
===== Less than ===== | |||
[[File:LESS_THAN_logic_symbol.png|frameless|35x35px]] "''Outputs an on signal if the first input is less than the second.''" | |||
===== Memory Register===== | |||
[[File:MEMORY_REGISTER_logic_symbol.png|frameless|35x35px]] "''Remembers the input value when receiving a signal to the Set node. When the Reset node receives a signal, the stored number is cleared to a value that can be customised in the properties panel.''" | |||
===== Numerical Junction ===== | |||
[[File:NUMERICAL_JUNCTION_logic_symbol.png|frameless|35x35px]] "''Outputs the input number to one of the outputs depending on whether or not the Switch Signal is on. The path that the input doesn't take will output a value of 0''" | |||
===== Numerical Switchbox ===== | |||
[[File:NUMERICAL_SWITCHBOX_logic_symbol.png|frameless|35x35px]] "''Outputs an on signal if the first input is less than the second.''" | |||
===== Threshold===== | |||
[[File:THRESHOLD_GATE_logic_symbol.png|frameless|35x35px]] "''Outputs the first input value when receiving an on signal, and the second when receiving an off signal.''" | |||
===== Timer (<code>RTF</code> & <code>RTO</code> & <code>TOF</code> & <code>TON</code>) ===== | |||
[[File:TIMER_logic_symbol.png|frameless|35x35px]] "''Variable input timer.''" | |||
<code>RTF</code> - Outputs an on signal when the timer is less than its duration, resets when signalled | |||
<code>RTO</code> - Outputs an on signal when the timer reaches its duration, resets when signalled | |||
<code>TOF</code> - Outputs an on signal when the timer is less than its duration, resets when off | |||
<code>TON</code> - Outputs an on signal when the timer reaches its duration, resets when off | |||
===== Up/Down Counter ===== | |||
[[File:UPDOWN_logic_symbol.png|frameless|35x35px]] "''Has an internal value that will increase and decrease when receiving different signals.''" | |||
===== PID Controller (& advanced variant) ===== | |||
[[File:PID_logic_symbol.png|frameless|35x35px]] "''A basic PID controller. The proportional integral and derivative gains can be set in the property panel.''" | |||
[[File:PID_logic_symbol.png|frameless|35x35px]] "''A PID controller with variable proportional, integral and derivative gains.''" | |||
For more information and how to use PIDs, refer to [[PID Controllers]] | |||
=== "Composite" gates === | |||
[[File:Composite tab - logic nodes.png|frameless|682x682px]] | |||
This section is for the "Composite" nodes tab in the Parts Menu. | |||
===== Composite Read (number) ===== | |||
[[File:COMPOSITE_READ_logic_symbol.png|frameless|35x35px]] "''Reads the number value from a selected channel of a composite input.''" | |||
===== Composite Read (on/off) ===== | |||
[[File:COMPOSITE_READ_logic_symbol.png|frameless|35x35px]] "''Reads the on/off value from a selected channel of a composite input.''" | |||
===== Composite Write (number) ===== | |||
[[File:COMPOSITE_WRITE_logic_symbol.png|frameless|35x35px]] "''Writes up to 32 numbers to a composite link in a single logic tick. Only connected channels will be modified. The number of inputs and the channel to begin writing at can be configured.''" | |||
===== Composite Write (on/off) ===== | |||
[[File:COMPOSITE_WRITE_logic_symbol.png|frameless|35x35px]] "''Writes up to 32 on/off signals to a composite link in a single logic tick. Only connected channels will be modified. The number of inputs and the channel to begin writing at can be configured.''" | |||
===== Composite Switchbox ===== | |||
[[File:COMPOSITE_SWITCHBOX_logic_symbol.png|frameless|35x35px]] "''Outputs the first input composite when receiving an on signal, and the second when receiving an off signal.''" | |||
===== Video Switchbox ===== | |||
[[File:VIDEO_SWITCHBOX_logic_symbol.png|frameless|35x35px]] "''Outputs the first input video when receiving an on signal, and the second when receiving an off signal.''" | |||
===== Audio Switchbox ===== | |||
[[File:AUDIO_SWITCHBOX_logic_symbol.png|frameless|35x35px]] "''Outputs the first input audio when receiving an on signal, and the second when receiving an off signal.''" | |||
===== Number to Composite Binary ===== | |||
[[File:COMPOSITE_BINARY_logic_symbol.png|frameless|35x35px]] "''Converts a number (rounded) to binary and outputs the bits as composite on/off signals.''" | |||
===== Composite Binary to Number ===== | |||
[[File:COMPOSITE_BINARY_logic_symbol.png|frameless|35x35px]] "''Reads the on/off signals of a composite link and encodes them in the bits of an output number.''" | |||
===== LUA Script ===== | |||
[[File:LUA_SCRIPT_logic_symbol.png|frameless|35x35px]] "''Runs a custom lua script for advanced logic and drawing to monitors.''" | |||
[[Category:Stormworks Technical Information]] | [[Category:Stormworks Technical Information]] | ||
Latest revision as of 01:40, 18 March 2026
Introduction
Microcontrollers are a way of condensing logic in Stormworks, they are programable processors that can be custom made to fulfil a wide array of tasks and use cases within Stormworks using Lua blocks, Logic Gates, mathematical functions, etc. With microcontrollers (MCs) you can use a variety of logic gates that are not accessible through the traditional parts menu within the vehicle builder, as a result not only are MCs good at condensing logic, but also give the player access to a wider variety of options and paths to take in order to fulfil the required task.
This page will go over how to create a microcontroller, and go through a majority of the logic blocks that are found within Stormworks and show you examples on how they are used with images.
Creating a Microcontroller

Properties Initial setup.

Step 1 in any MC is creating one. At the top of your vehicle editor you will see 8 tabs, you want to select the final one labelled "Microcontroller Editor". Once in this mode, it will default you to the "Design" settings and you will see 3 tabs; "Properties", "Logic" and "Symbol".
- Properties tab is where you will define a name and description for your microcontroller; this is what it will appear as in your parts menu. You also will have the opportunity to define the size of your microcontroller; with the smallest scale being
1 Block × 1 Block × 1 Blockand the maximum being6 Block × 6 Block × 1 Block. It is important to select the correct size however this can be edited at any time, you can make it as large as possible and condense later. - Logic tab is where you will set the various logic nodes.
- Symbol Tab is where you will setup the symbol that will appear in the parts menu for your microcontroller. This is done by toggling each pixel from dark grey to light grey in a
16 × 16grid.
Logic Nodes
Step 2 in creating a microcontroller is assigning your Logic Nodes. To do this, go to the "Logic" tab in the microcontroller designer and select the large blue addition symbol which is labelled "Add Node" when you hover your mouse over it. Once done, you will see a red on/off input node appear in the list, as well as a red circle appear on the microcontroller in the bottom left slot. From here, we can choose the kind of node, and whether or not we want the node to be an input variable (going into the microcontroller) or an output variable (leaving the microcontroller), here you can also set a name and a description for your logic nodes. The different forms of logic nodes are;

on/off- Alternatively referred to as Boolean nodes; this is your basic binary On or Off logic transfer node. The default colouring is Rednumber- This node will transfer a numerical value. The default colouring is Green.composite- This is your composite channel node; containing 32 channels for bothon/offand/ornumberdata, Meaning it is possible to pass 64 different channels of information through this single node, provided 32 differenton/offvalues and 32 differentnumbervalues. The default colouring is Purple.video- This node will allow you to output a video to various components (e.g. monitor, HUD, etc) or input from a Camera component to be modified (e.g. adding a sight or data to a HUD). The default colouring is Light Blue.audio- This node will allow you to input and manipulate audio from microphones. The default colouring is Khaki Green.
Following game version v1.15.10 - The Microcontroller Layers Update[1] in January of 2026 you are now able to layer logic nodes over one-another allowing for more compact microcontrollers.
Logic Editor
The Final step is going into the logic editor; represented at the top of the Microcontroller editor by the Lightbulb. This will bring you to a large grid with its own toolbar and parts menu that includes various logic gates for various different functions; in here you will also see the nodes you have selected in the "Design" tab as boxes with node input or output anchors, that share the same name and description as given in the Logic Design tab. Now you can start making your microcontroller's logic.
Logic Gates
Once you have successfully set up your logic nodes; you can begin to learn what the various logic gates do. To understand this, we will need to first understand what a truth table is; a Truth Table[2] is used to map out various logic gate or mathematical outcomes in a given system. (see example of an AND gate truth table below). In this page; we will be using A, B, C as inputs variable, and Q as output variable.
| AND Gate Example | ||
|---|---|---|
| A | B | Q |
| 0 | 0 | 0 |
| 1 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 1 | 1 |
"Arithmetic" gates
This section is for the "Arithmetic" gates tab in the Parts Menu.
Abs
"Outputs the absolute value of the input value (negative numbers become positive)."
Useful if you need to know "how far is x from 0", or when needing to guarantee that something is a positive number.
in = 1 out = 1
in = -1 out = 1
in = -15 out = 15
Add
"Adds the two input values together and outputs the result."
Simply adds the two inputs together
x=1 y=1, out=2
x=10 y=-5, out=5
Subtract
"Subtracts the second input from the first input and outputs the result."
Subtracts the second number from the first, can also be understood as an Add block except the second input is inverted
x=2 y=1, out=1
x=10 y=5, out=5
Multiply
"Multiplies the two input values and outputs the result."
Multiplies the two inputs together
x=2 y=2, out=4
x=10 y=5, out=50
Divide
"Divides the first input by the second and outputs the result."
Divides the first number by the second number.
If dividing by 0, it will output 0 on the Number output and output True on the Boolean output instead.
x=4 y=2, out=2
x=10 y=2, out=5
Clamp
"Clamps the input value between a set min and max and outputs the result."
The input number will be clamped to always be within the range set in the properties
x=4 range=(-1, 1), out=1
x=4 range=(-5, 5), out=4
x=-10 range=(-5, 5), out=-5
Equal
"Compares whether or not two numbers are equal within a set accuracy."
Checks if two numbers are equal, outputs true if they are.
The "Epsilon" setting within it sets the threshold for how close numbers have to be to be considered equal.
x=4 y=4 epsilon=0.1, output=true
x=4 y=3 epsilon=0.1, output=false
x=4 y=3 epsilon=1, output=true
Constant Number
"Outputs a constant number that is set on the properties panel."
Always output the number set in the properties.
Delta
"Outputs the difference between the input and the input from the previous tick.'"
Measures the rate of change of a number, by subtracting the value from the previous tick from the current value.
Can be used to measure rates such as rate of fuel consumption by inputting fuel level.
Modulo (fmod)
"Outputs the modulo of input A by input B.'"
Outputs the remainder from diving input one by input two.
x=3 y=2, output=1
x=5 y=2 epsilon=0.1, output=1
x=12 y=5 epsilon=1, output=2
Arithmetic Function (x & x,y,z & x,y,z,w,a,b,c,d)
"Evaluates a mathematical expression with up to (1 / 3 / 8) input variables and outputs the result.'"
The Arithmetic Function block can perform arithmetic operations on its inputs using the operators:
+ - Addition
- - Subtraction
* - Multiplication
/ - Division
% - Modulo
^ - Power
It also has the constants:
pi - The value of Pi
pi2 - The value of Pi multiplied by 2
And the Trigonometric Functions:
sin(x) - Outputs the Sine of x
cos(x) - Outputs the Cosine of x
tan(x) - Outputs the Tangent of x
asin(x) - Outputs the Arcsine of x
acos(x) - Outputs the Arccosine of x
atan(x) - Outputs the Arctangent of x
atan2(x, y) -
It also has functions for:
max(x,y) - Outputs the higher value
min(x,y) - Outputs the lower value
ceil(x) - Rounds x up
floor(x) - Rounds x down
round(x) - Rounds x (normally)
abs(x) - Outputs the absolute value of x
sgn(x) - Outputs the sign of x (1 if positive or x=0) (-1 if negative)
sqrt(x) - Outputs the square root of x
len(x,y) - Outputs the length of the vector (x,y)
len2(x,y) - Outputs the length of the vector (x,y) without square rooting the result
lerp(x,y,z) - Linearly interpolates from x to y using z as the position
clamp(x,y,z) - Clamps x to be within y and z
"Logical" gates
This section is for the "Logical" gates tab in the Parts Menu.
AND Gate
"Outputs the logical AND of its two input signals."
This logic gate will only output a signal if both inputs are toggled on.

| Truth Table | ||
|---|---|---|
| A | B | Q |
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
NAND Gate
"Outputs the logical NAND of its two input signals."
This will output a signal if either of the signals are toggled on; but will output no signal if both inputs are toggled on.

| Truth Table | ||
|---|---|---|
| A | B | Q |
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
OR Gate
"Outputs the logical OR of its two input signals."
This will output an On signal if either of the 2 inputs are toggled on. This is the most common way of combining 2 on/off signals.

| Truth Table | ||
|---|---|---|
| A | B | Q |
| 0 | 0 | 0 |
| 1 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 1 | 1 |
NOR Gate
"Outputs the logical NOR of its two input signals."
This gate will only output a signal if neither input is toggled on. If either or both inputs are toggled on, the gate will not output any signal.

| Truth Table | ||
|---|---|---|
| A | B | Q |
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
XOR Gate
"Outputs the Logical XOR of its two input signals."
This gate outputs a signal if only output a signal if either A or B are toggled on; but wont output a signal if both or neither are enabled.

| Truth Table | ||
|---|---|---|
| A | B | Q |
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
NOT Gate
"Outputs the logical NOT of its input signal."
This will output the opposing signal inputted; On becomes Off, Off becomes On.

| Truth Table | |
|---|---|
| A | Q |
| 1 | 0 |
| 0 | 1 |
Pulse (Toggle to Push)
"A switch that outputs a single tick pulse. It can be configured to pulse when being switched from off to on (default), on to off, or always when the input signa-l changes."
Push To Toggle
"An on/off switch that is toggled every time a new on signal is sent to its input."
JK Flip Flop
"An JK Flip flop that can be set and reset using two on/off inputs."
SR Latch
"An SR latch that can be set and reset using two on/off inputs."
Constant On Signal
"Outputs a constant on signal."
This will output a constant on signal.

| Truth Table |
|---|
| Q |
| 1 |
Boolean Functions (Both x,y,z,w & x,y,z,w,a,b,c,d)
"Evaluates a logical expression with up to 4 to 8 input variables and outputs the result."
The Boolean Functions block can perform any number and combination of AND, OR, XOR, and NOT operations on its boolean inputs using the operators:
& - AND
| - OR
^ - XOR
! - NOT
"Control" gates
This section is for the "Control" nodes tab in the Parts Menu.
Blinker
"Outputs a value that blinks on and off at a set rate."
Capacitor
"Charges up when receiving an on signal, then discharges over a period of time."
Greater than
"Outputs an on signal if the first input is greater than the second."
Less than
"Outputs an on signal if the first input is less than the second."
Memory Register
"Remembers the input value when receiving a signal to the Set node. When the Reset node receives a signal, the stored number is cleared to a value that can be customised in the properties panel."
Numerical Junction
"Outputs the input number to one of the outputs depending on whether or not the Switch Signal is on. The path that the input doesn't take will output a value of 0"
Numerical Switchbox
"Outputs an on signal if the first input is less than the second."
Threshold
"Outputs the first input value when receiving an on signal, and the second when receiving an off signal."
Timer (RTF & RTO & TOF & TON)
RTF - Outputs an on signal when the timer is less than its duration, resets when signalled
RTO - Outputs an on signal when the timer reaches its duration, resets when signalled
TOF - Outputs an on signal when the timer is less than its duration, resets when off
TON - Outputs an on signal when the timer reaches its duration, resets when off
Up/Down Counter
"Has an internal value that will increase and decrease when receiving different signals."
PID Controller (& advanced variant)
"A basic PID controller. The proportional integral and derivative gains can be set in the property panel."
"A PID controller with variable proportional, integral and derivative gains."
For more information and how to use PIDs, refer to PID Controllers
"Composite" gates
This section is for the "Composite" nodes tab in the Parts Menu.
Composite Read (number)
"Reads the number value from a selected channel of a composite input."
Composite Read (on/off)
"Reads the on/off value from a selected channel of a composite input."
Composite Write (number)
"Writes up to 32 numbers to a composite link in a single logic tick. Only connected channels will be modified. The number of inputs and the channel to begin writing at can be configured."
Composite Write (on/off)
"Writes up to 32 on/off signals to a composite link in a single logic tick. Only connected channels will be modified. The number of inputs and the channel to begin writing at can be configured."
Composite Switchbox
"Outputs the first input composite when receiving an on signal, and the second when receiving an off signal."
Video Switchbox
"Outputs the first input video when receiving an on signal, and the second when receiving an off signal."
Audio Switchbox
"Outputs the first input audio when receiving an on signal, and the second when receiving an off signal."
Number to Composite Binary
"Converts a number (rounded) to binary and outputs the bits as composite on/off signals."
Composite Binary to Number
"Reads the on/off signals of a composite link and encodes them in the bits of an output number."
LUA Script
"Runs a custom lua script for advanced logic and drawing to monitors."
- ↑ Steam Announcement Page for update.https://store.steampowered.com/news/app/573090/view/507351614918492485
- ↑ Wikipedia Page for Truth tables https://en.wikipedia.org/wiki/Truth_table