×
Create a new article
Write your page title here:
We currently have 276 articles on Waste Of Space Wiki. Type your article name above or create one of the articles listed here!



    Waste Of Space Wiki

    Microcontroller: Difference between revisions

    Content added Content deleted
    No edit summary
    mNo edit summary
     
    (9 intermediate revisions by 6 users not shown)
    Line 1: Line 1:
    {{Object
    {{Object
    |title1 = {{PAGENAME}}
    |title1 = {{PAGENAME}}
    |image1 = Microcontroller.png
    |image1 =
    |type = {{#invoke:GetPartInfo|getField|Type}}
    |type = {{#invoke:GetPartInfo|getField|Type}}
    |malleability={{#invoke:GetPartInfo|getField|Malleability}}
    |durability={{#invoke:GetPartInfo|getField|Durability}}
    |flammable={{#invoke:GetPartInfo|getField|Flammable}}
    |recipe={{#invoke:GetPartInfo|getField|Recipe}}
    |recipe={{#invoke:GetPartInfo|getField|Recipe}}
    |raw_recipe={{#invoke:GetPartInfo|getField|Raw recipe}}
    |raw_recipe={{#invoke:GetPartInfo|getField|Raw recipe}}
    |configuration={{#invoke:GetPartInfo|getField|Configuration}}
    |configuration={{#invoke:GetPartInfo|getField|Configuration}}
    |consumes=[[Power]]
    |malleability={{#invoke:GetPartInfo|getField|Malleability}}
    |default_size={{#invoke:GetPartInfo|getField|DefaultSize}}
    |durability={{#invoke:GetPartInfo|getField|Durability}}
    |default_colour={{#invoke:GetPartInfo|getField|DefaultColor}}
    |flammable={{#invoke:GetPartInfo|getField|Flammable}}
    }}
    }}


    The '''microcontroller''' is a part used to run code. When activated with a [[polysilicon]], it will attempt to run its configured code value. Below is a diagram explaining how to place [[Port|ports]] and [[EthernetCable|ethernet cables]] for use with a microcontroller.
    The '''microcontroller''' is a part used to run code. When activated with a [[polysilicon]], it will attempt to run its configured code value. Microcontrollers run on Pilot.lua, which is basically just normal rbx.lua with a few things added to interact with the game. Visit the [[Programming]] page for more info. Below is a diagram explaining how to place [[Port|ports]] and [[EthernetCable|ethernet cables]] for use with a microcontroller.
    [[File:MicrocontrollerDiagram.png|caption]]
    [[File:MicrocontrollerDiagram.png|caption]]


    == Microcontroller related parts ==
    == Microcontroller related parts ==
    Line 29: Line 32:
    * [[StarMap]]
    * [[StarMap]]
    * [[Telescope]]
    * [[Telescope]]

    Microcontrollers run on Pilot.lua, which is basically just normal lua with a few things added to interact with the game.


    == Microcontroller globals ==
    == Microcontroller globals ==
    Line 43: Line 44:


    === Beep() ===
    === Beep() ===
    Makes the microcontroller beep
    Makes the Microcontroller beep
    <code> Beep(1) --beeps with a pitch of 1 </code>
    <code> Beep(1) --beeps with a pitch of 1 </code>


    Line 80: Line 81:


    Keyboard:Connect("TextInputted", FuncName) --runs the function when keyboard gets input </nowiki> </code>
    Keyboard:Connect("TextInputted", FuncName) --runs the function when keyboard gets input </nowiki> </code>

    ==Pilot.lua Wiki==
    For more information about microntroller coding refer to this: https://github.com/iimurpyh/pilot-lua/wiki


    ==In-game Description==
    ==In-game Description==
    Line 85: Line 89:


    ==Configuration==
    ==Configuration==
    You can input code or a URL that leads directly to the code.
    {{#invoke:GetPartInfo|getField|ConfigurationLarge}}


    [[Category:Parts]]
    [[Category:Parts]]

    Latest revision as of 22:55, 22 April 2024

    The microcontroller is a part used to run code. When activated with a polysilicon, it will attempt to run its configured code value. Microcontrollers run on Pilot.lua, which is basically just normal rbx.lua with a few things added to interact with the game. Visit the Programming page for more info. Below is a diagram explaining how to place ports and ethernet cables for use with a microcontroller. caption

    Microcontroller related parts[edit | hide all | hide | edit source]

    Microcontroller globals[edit | hide | edit source]

    GetPartFromPort()[edit | hide | edit source]

    Gets the first part it finds connected to the port

     GetPartFromPort(2, "Switch") --gets the first switch connected to the second port 
    

    TriggerPort()[edit | hide | edit source]

    Sends a trigger signal from a port

     TriggerPort(5) --sends a trigger signal out of the 5th port 
    

    Beep()[edit | hide | edit source]

    Makes the Microcontroller beep

     Beep(1) --beeps with a pitch of 1 
    

    Parts[edit | hide | edit source]

    :Configure()[edit | hide | edit source]

    Configure can be run on any part. It works like configuring with hammer tool.

      local Switch = GetPartFromPort(2, "Switch") --gets the first switch connected to the second port 
    
    Switch:Configure( {SwitchValue = true} ) --sets the switch to be on  
    

    :Trigger()[edit | hide | edit source]

    Simulates the part receiving a trigger signal

      local Anchor = GetPartFromPort(1, "Anchor") --gets the first anchor connected to the first port 
    
    Anchor:Trigger() --triggers the anchor  
    

    :Connect()[edit | hide | edit source]

    Connects to a part's event, such as a keyboard input.

      local Sign = GetPartFromPort(1, "Sign") --gets a sign
    
     local Keyboard = GetPartFromPort(2, "Keyboard") --gets a keyboard
    
    
    local function FuncName(text) --function that runs when keyboard gets input
    
        text = text:sub(1, -2) --removes the newline from pressing enter to confirm keyboard input
    
        Sign:Configure( { SignText = text } )
    
    end --ends the function
    
    
    Keyboard:Connect("TextInputted", FuncName) --runs the function when keyboard gets input  
    

    Pilot.lua Wiki[edit | hide | edit source]

    For more information about microntroller coding refer to this: https://github.com/iimurpyh/pilot-lua/wiki

    In-game Description[edit | hide | edit source]

    "Runs computer programs when triggered and powered. When triggered by an activator polysilicon, it will run code. When triggered by a deactivator polysilicon, it will stop running code. For more information on pilot.lua or the game's programming system, visit the programming tutorial or visit the wiki for the game online. Requires 5 power per second when running. Microcontroller Globals: void Beep(number Pitch) - default pitch 1, max 10 beeps playing concurrently object GetPort(number PortID) - returns port configured with 'PortID' object GetPartFromPort/GetPartsFromPort(object/number Port, string ClassName) - gets a part connected to port 'Port' with classname 'ClassName' void TriggerPort(object/number Port) - sends a trigger signal from the port 'Port' Globals also include all lua globals and all rbx.lua globals, except for roblox script-related or game-related globals such as workspace, game, stats, time, etc. "

    Configuration[edit | hide | edit source]

    You can input code or a URL that leads directly to the code.

    Cookies help us deliver our services. By using our services, you agree to our use of cookies.

    Recent changes

  • Axenori • 3 days ago
  • Voivsone • 4 days ago
  • Axenori • 4 days ago
  • Axenori • 5 days ago
  • Cookies help us deliver our services. By using our services, you agree to our use of cookies.