From ComputerCraft Wiki
Revision as of 13:35, 18 July 2013 by Cranium (Talk | contribs) (Changing int to number)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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


Grid paper.png  Example
Makes the computer output a redstone signal at various strengths
redstone.setAnalogOutput("back", 15)
redstone.setAnalogOutput("back", 10)
redstone.setAnalogOutput("back", 5)
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