load("/home/student/creativerobotics/urbi-for-bioloid/dynamixel.u");
var Global.d = Dynamixel.new;
class Thing
{
function init()
{
/* var this.shoulder =
Dynamixel.Device.new(d,1,Dynamixel.DeviceDesc.AX12);
var this.elbow =
Dynamixel.Device.new(d,2,Dynamixel.DeviceDesc.AX12);
var this.wrist =
Dynamixel.Device.new(d,3,Dynamixel.DeviceDesc.AX12);
var this.hand =
Dynamixel.Device.new(d,4,Dynamixel.DeviceDesc.AX12);
*/
var this.sensorH = Dynamixel.Device.new(d,100,
Dynamixel.DeviceDesc.AXS1);
var this.sensorRead = 0;
};
function start_feedback(){
detach
({
every(0.1s)
{
this.sensorRead = this.sensorH.lightLeft;
}
});
};
function startReact(){
whenever(sensorRead10)
{
echo("lighjt");}
};
};
var thing2 = Thing.new;
thing2.start_feedback;
thing2.startReact;
No comments:
Post a Comment