24 lines
722 B
Markdown
24 lines
722 B
Markdown
|
# Oscilloscope
|
||
|
Oscilloscope with customizable trigger and polling rate.
|
||
|
|
||
|
## Setup
|
||
|
1. Open the script in the editor
|
||
|
2. Set the side wich the redstone signal will be read from
|
||
|
3. Set the interval at which the signal will be polled (setting it below 0.05 will not give more resolution as this is the tickspeed)
|
||
|
4. (Optional) Customize the trigger function to trigger when you want it to (see examples below).
|
||
|
|
||
|
### Example triggers
|
||
|
Trigger when receiving full signal:
|
||
|
```lua
|
||
|
local trigger = function(previous, current)
|
||
|
return current == 15
|
||
|
end
|
||
|
```
|
||
|
|
||
|
Triggers when the difference in the measured signals is more than positive 7:
|
||
|
```lua
|
||
|
local trigger = function(previous, current)
|
||
|
return (current - previous) > 7
|
||
|
end
|
||
|
```
|