redstone.getAnalogInput

From ComputerCraft Wiki
Revision as of 23:47, 5 May 2013 by Smiley43210 (Talk | contribs) (Created function page with example)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


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 int 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