Component/microcontroller: Difference between revisions

From OpenComputers: Rebooted
Jump to navigation Jump to search
imported>OCDoc Import
Imported from legacy OpenComputers documentation at ocdoc.cil.li
 
Clean up Markdown artifacts from DokuWiki migration
 
Line 5: Line 5:
These callbacks can only be called by the microcontroller itself, or its direct neighbors (i.e. other computers that share a face with the microcontroller). Note that since microcontrollers cannot access external components they cannot interact with each others microcontroller components, but a computer can access a neighbouring microcontroller.
These callbacks can only be called by the microcontroller itself, or its direct neighbors (i.e. other computers that share a face with the microcontroller). Note that since microcontrollers cannot access external components they cannot interact with each others microcontroller components, but a computer can access a neighbouring microcontroller.


Component name: `microcontroller`. Callbacks:
Component name: <code>microcontroller</code>. Callbacks:


* `setSideOpen(side: number, open: boolean): boolean`
* <code>setSideOpen(side: number, open: boolean): boolean</code>


<pre>Set whether network messages are sent via the specified side.
<pre>Set whether network messages are sent via the specified side.
</pre>
</pre>
* `start(): boolean`
* <code>start(): boolean</code>


<pre>Starts the microcontroller. Returns true if the state changed.
<pre>Starts the microcontroller. Returns true if the state changed.
</pre>
</pre>
* `isRunning(): boolean`
* <code>isRunning(): boolean</code>


<pre>Returns whether the microcontroller is running.
<pre>Returns whether the microcontroller is running.
</pre>
</pre>
* `isSideOpen(side: number): boolean`
* <code>isSideOpen(side: number): boolean</code>


<pre>Get whether network messages are sent via the specified side.
<pre>Get whether network messages are sent via the specified side.
</pre>
</pre>
* `lastError(): string`
* <code>lastError(): string</code>


<pre>Returns the reason the microcontroller crashed, if applicable. Returns nil if no crash has occurred.
<pre>Returns the reason the microcontroller crashed, if applicable. Returns nil if no crash has occurred.
</pre>
</pre>
* `stop(): boolean`
* <code>stop(): boolean</code>


<pre>Stops the microcontroller. Returns true if the state changed.
<pre>Stops the microcontroller. Returns true if the state changed.
</pre>
</pre>
{{:Component/contents}}
{{:Component/contents}}

Latest revision as of 20:27, 24 August 2026

Component: Microcontroller

This is the component provided by the Microcontroller Case.

These callbacks can only be called by the microcontroller itself, or its direct neighbors (i.e. other computers that share a face with the microcontroller). Note that since microcontrollers cannot access external components they cannot interact with each others microcontroller components, but a computer can access a neighbouring microcontroller.

Component name: microcontroller. Callbacks:

  • setSideOpen(side: number, open: boolean): boolean
Set whether network messages are sent via the specified side.
  • start(): boolean
Starts the microcontroller. Returns true if the state changed.
  • isRunning(): boolean
Returns whether the microcontroller is running.
  • isSideOpen(side: number): boolean
Get whether network messages are sent via the specified side.
  • lastError(): string
Returns the reason the microcontroller crashed, if applicable. Returns nil if no crash has occurred.
  • stop(): boolean
Stops the microcontroller. Returns true if the state changed.
Components
Core Components Access Point - Computer - Drone - Drive - EEPROM - Filesystem - GPU - Microcontroller - Modem - Redstone - Robot - Transposer
Others Component Access - Signals
Cross-Mod Integration Applied Energistics