Difference between revisions of "Redstone.getAnalogInput"

From ComputerCraft Wiki
Jump to: navigation, search
(Created function page with example)
 
(Changing int to number)
 
Line 3: Line 3:
 
|name=redstone.getAnalogInput
 
|name=redstone.getAnalogInput
 
|args={{type|string}} side
 
|args={{type|string}} side
|returns={{type|int}} strength
+
|returns={{type|number}} strength
 
|desc=Returns the strength of a redstone signal (0-15) on ''side''. If there is no redstone signal on ''side'', returns 0. If there is a redstone source (a redstone block or torch) on ''side'', returns 15.
 
|desc=Returns the strength of a redstone signal (0-15) on ''side''. If there is no redstone signal on ''side'', returns 0. If there is a redstone source (a redstone block or torch) on ''side'', returns 15.
 
|api=redstone
 
|api=redstone

Latest revision as of 13:35, 18 July 2013


Grid Redstone.png  Function redstone.getAnalogInput
Returns the strength of a redstone signal (0-15) on side. If there is no redstone signal on side, returns 0. If there is a redstone source (a redstone block or torch) on side, returns 15.
Syntax redstone.getAnalogInput(string side)
Returns number strength
Part of ComputerCraft
API redstone

Examples

Grid paper.png  Example
Prints the strength of a redstone signal on the left side
Code
print("Redstone strength on left: " .. redstone.getAnalogInput("left"))
Output A number from 0-15 representing the redstone strength