// perform the 2nd stage setup that requires YoctoAPI object
 protected void init(YTilt hwd)
 {
     if (hwd == null)
     {
         return;
     }
     base.init(hwd);
     InternalStuff.log("registering Tilt callback");
     _func.registerValueCallback(valueChangeCallback);
 }
    void YoctopuceInitialisation()
    {
        Debug.Log("Use Yoctopuce Lib " + YAPI.GetAPIVersion());
        string errmsg = "";
        int    res    = YAPI.RegisterHub("usb", ref errmsg);

        if (res != YAPI.SUCCESS)
        {
            Debug.Log("error with RegisterHub:" + errmsg);
            errorText.text = errmsg;
            return;
        }
        YModule module = YModule.FirstModule();

        while (module != null)
        {
            string product = module.get_productName();
            if (product == "Yocto-3D" || product == "Yocto-3D-V2")
            {
                Debug.Log("Use " + product + " " + module.get_serialNumber());
                break;
            }
            module = module.nextModule();
        }
        if (module == null)
        {
            errorText.text = "No Yocto-3D or Yocto-3D-V2 found";
            return;
        }
        string serial = module.get_serialNumber();

        tilt_x = YTilt.FindTilt(serial + ".tilt1");
        tilt_z = YTilt.FindTilt(serial + ".tilt2");

        tilt_x.registerValueCallback(TiltCallbackX);
        tilt_z.registerValueCallback(TiltCallbackZ);
    }