The Input Switch is an user interface unit allowing your Programmable Robot (or other devices supporting the GetInfo and SetInfo interfaces) to communicate with the user. The user can activate the switch with the middle click of the mouse and the program of your robot can read its state and modify it's behavior. The switch is also reversible, ie the Programmable Robot can change its state.
Use the following manufacturing instructions to make the item. If you do not know how to use them, follow how to understand manufacturing instructions
The Input Switch can be used with the Voxel_GetInfo(), Voxel_SetInfo() and Voxel_GetInfoDoc() functions of the Programmable Robot. Read the Programming Manual for more informations.
Here is the GetInfo/Setinfo interface Index functionnalities :
Index | Property | Read/Write | Read Type | Write Type |
0 | Max Number for index | R | [integer] | |
1 | Input Switch State | R/W | [integer] | [bool][Integer] |
Make a Programmable Robot an put the Input Switch on top of it. Then, try the following program :
// Example #1: Get the state of the voxel at the top of the robot.
function Voxel_Step()
{
local State;
State = Voxel_GetInfo(0,1,0,1);
Display("BUTTON STATE : " + State, 500,2,0);
}
You can collect it using any constructor/destructor.
The Input Switch was introduced in Blackvoxel 1.3 (and preceding beta versions).
Active Voxel : No
Physical Form : Solid
Interface(s) : GetInfo, SetInfo
VoxelType : 214, 215