bundleAPI.getInput("side", "color") should now work properly!
This API sends and recieves Redstone signals through bundled cable.
Can handle 96 outputs or inputs! 16 from each side a bundle is connected to.
Use help() to read the directions for use.
Sides are defined with "back" or "left"
Uses standard color names such as "red" or "lightBlue"
Works with american and europeon versions of gray/grey
Will also accept lowercase multi-word colors such as "lightblue" instead of "lightBlue"
Make sure to include the following line in your program:
os.loadAPI ("bundleAPI")
UPDATED:
-Added proper error handling
-Added pulse("side", "color", time)
help() prints the help menu.
getVersion() returns version number of the API.
on("side", "color") turns ON the selected color on the selected side.
off("side", "color") turns OFF the selected color on the selected side.
toggle("side", "color") Toggles the selected color on the selected side.
getOutput("side", "color") returns a 0 or 1 depending on what has been turned off or on.
getInput("side", "color") returns a 0 or 1, reads an input or output as on.
resetAll() turns off all colors on all sides.
resetSide("side") turns off all colors on selected side.
resetColor("color") turns off all of selected color on all sides.
pulse("side", "color", time) toggles the side and color for the specified time for example 1 for one second or 0.5 for 1/2 a second.
example usage:
bundleAPI.toggle("back", "cyan") – toggles off or on the cyan cable on the back side.
bundleAPI.getInput("bottom", "lightGrey") – will return the current state of the lightGrey cable connected to the bottom of the computer.
bundleAPI.off("up", "lightgray") – Makes sure the lightgray cable is off on the Top side. Keeps track and knows if the cable has been turned off before, and will not turn it off again. This keeps the color signal from messing up. Accepts up or down as alternates for top and bottom as well as lightgrey/lightGrey/lightgray/lightGray as alternates for US/EU colors.
Type this in your computers console to download automatically!
pastebin get 9iYHAYq8 bundleAPI
or use the URL to look at the code: http://pastebin.com/9iYHAYq8
Also here is an example program that is also useful for signal testing.
Select a side and it will slowly toggle the colored cables one at a time on that side.
Type this in your computers console to download automatically!
pastebin get W3EihMr2 bundleAPI
or use the URL to look at the code: http://pastebin.com/W3EihMr2