redstone.setAnalogOutput

From ComputerCraft Wiki
Jump to: navigation, search


Grid Redstone.png  Function redstone.setAnalogOutput
Sets the strength of redstone output to strength on side. strength must be an integer between 0 and 15, 0 being off, and 15 being the strongest.
Syntax redstone.setAnalogOutput(string side, number strength)
Returns nil
Part of ComputerCraft
API redstone

Examples

Grid paper.png  Example
Makes the computer output a redstone signal at various strengths
Code
redstone.setAnalogOutput("back", 15)
sleep(2)
redstone.setAnalogOutput("back", 10)
sleep(2)
redstone.setAnalogOutput("back", 5)
sleep(2)
redstone.setAnalogOutput("back", 0)
Output A block at the back of the computer will receive a strong redstone signal at first, and that signal will slowly diminish.

Additional Notes

  • This function will throw an error if you give it an invalid side.
  • List of possible sides: left, right, front, back, bottom, top
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox