Redstone Adapter
Read and drive vanilla redstone from a computer: analog levels, comparators, pulse counts and crop sensing.
The
Redstone Adapter joins vanilla redstone to the computers, so a program
can read and drive a farm or circuit.
Connect it
- It is a Redbus device. Run
Ribbon Cable to the IDC header at the foot of its
back, or put its back against a computer device. - The other five sides are redstone inputs and outputs, each with a red alloy terminal at its foot, where dust or red alloy wire on the floor meets it.
- Its Redbus address starts at 10. Sneak-click it, or use a screwdriver, to change it.
Sides
| Number | Side | Name |
|---|---|---|
| 0 | bottom | bottom |
| 1 | top | top |
| 2 | back | (the ribbon) |
| 3 | front | front |
| 4 | right | right |
| 5 | left | left |
Compass names such as north and up also work. Left and right are the adapter's own sides, as in
ComputerCraft: stand behind it to see them as yours.
The front panel has one column per side, labelled R F T B L from your left as you face it. The green LED shows the side's input and the red LED its output, each as bright as the signal. Clicking the adapter shows every side's input and output.
What each side can do
- Input: the analog strength arriving, 0 to 15.
- Output: weak power at any strength from 0 to 15, like a block of redstone. The adapter does not conduct, so dust pointing into one side never reaches the others, and dust a side drives does not read back as its input.
- Comparator reading: what a comparator would read from the block there, such as a chest's or composter's fill level, also through one solid block.
- Pulse counter: rising edges since you last read them, so a program never misses an observer's short pulse.
- Timed pulse: full strength for a number of ticks, then back to the set output.
- Block sensor: the block there with its state, such as
minecraft:wheat[age=7], and whether a crop, stem, berry bush, nether wart or cocoa pod has finished growing.
Program it
A harvester loop: a chest on the left, the crop above, and a piston harvester on the front.
10 IF RSCMP(10, "left") > 13 THEN PRINT "CHEST FULL" : GOTO 40
20 IF RSGROWN(10, "top") THEN RSPULSE 10, "front", 4
30 SLEEP 20 : GOTO 10
40 END
| Where | Commands |
|---|---|
| DragonBASIC | RSOUT addr, side, 0-15, RSPULSE addr, side, ticks, RSIN(), RSOUT(), RSCMP(), RSCOUNT(), RSBLOCK$(), RSGROWN(). See machine commands. |
| Shell | rs 10 shows every side; rs 10 front 15 drives one; rs 10 pulse front 4 pulses it. |
| ComputerCraft | A redstone_adapter peripheral: getInput, getAnalogInput, getOutput, getAnalogOutput, setOutput, setAnalogOutput, pulse(side, ticks), getComparator, getPulses, getBlock, isGrown, getSides. Computers receive a redstone event when an input changes. |
Redbus registers
| Register | Use |
|---|---|
0x00–0x05 |
Input per side |
0x08–0x0D |
Output per side (write 0-15) |
0x10–0x15 |
Comparator reading |
0x18–0x1D |
Rising edges (write to clear) |
0x20–0x25 |
Pulse (write ticks) |
0x28 |
Input mask |
0x29 |
Output mask (write to set all sides on or off) |
0x2A |
Front direction |
0x3F |
Reads 0x52 |