redstone.getAnalogInput

From ComputerCraft Wiki
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 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
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox