-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add digilines doc file and document switching station interface
partially attends to #53
- Loading branch information
1 parent
b0e45d4
commit 3caab20
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
# Technic digilines compatibility | ||
|
||
This document describes the interaction of | ||
technic machines with the `digilines` mod (https://github.com/minetest-mods/digilines) | ||
|
||
## Switching station | ||
|
||
**NOTE**: make sure the channel is set accordingly, "switch" in this case | ||
|
||
Get power and lag stats: | ||
```lua | ||
if event.type == "program" then | ||
-- start interrupt cycle | ||
interrupt(1) | ||
end | ||
|
||
if event.type == "interrupt" then | ||
-- request stats | ||
digiline_send("switch", "GET") | ||
end | ||
|
||
if event.type == "digiline" and event.channel == "switch" then | ||
--[[ | ||
event.msg = { | ||
demand = 0, -- demand in EU's | ||
supply = 0, -- supply in EU's | ||
lag = 0 -- generated lag in microseconds | ||
} | ||
--]] | ||
end | ||
``` |