Difference between revisions of "Redstone.getAnalogOutput"

From ComputerCraft Wiki
Jump to: navigation, search
(Created function page with example)
 
(Changing int to number)
 
Line 3: Line 3:
 
|name=redstone.getAnalogOutput
 
|name=redstone.getAnalogOutput
 
|args={{type|string}} side
 
|args={{type|string}} side
|returns={{type|int}} strength
+
|returns={{type|number}} strength
 
|desc=Returns what was set with [[redstone.setAnalogOutput]]().
 
|desc=Returns what was set with [[redstone.setAnalogOutput]]().
 
|api=redstone
 
|api=redstone

Latest revision as of 13:35, 18 July 2013


Grid Redstone.png  Function redstone.getAnalogOutput
Returns what was set with redstone.setAnalogOutput().
Syntax redstone.getAnalogOutput(string side)
Returns number strength
Part of ComputerCraft
API redstone

Examples

Grid paper.png  Example
Sets the redstone output strength on the left to 7, then prints the output strength of the left side.
Code
redstone.setAnalogOutput("left", 7) -- Set the output strength on the left to 7
print(redstone.getOutput("left")) -- Print the output strength
Output Prints the strength of the redstone output, so in this case, 7.