redstone.getAnalogInput
From ComputerCraft Wiki
| 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
| 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 |