Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:Scarlet.Components.Sensors.BNO055"/> class, which will communicate via
        /// the given I2C bus.
        /// </summary>
        /// <param name="I2C"> The I2C bus to communicate over. </param>
        /// <param name="ID"> ID of BNO055. -1 by default. You probably shouldn't change this. </param>
        /// <param name="Address"> The I2C address of the BNO055. Defaults to 0x28. You probably shouldn't change this. </param>
        /// <param name="GPS"> A GPS to use to correct for location-based magnetic declination. </param>
        public BNO055(II2CBus I2C, int ID = -1, byte Address = BNO055_ADDRESS_A, IGPS GPS = null)
        {
            this.ID      = ID;
            this.Address = Address;
            this.I2C     = I2C;
            this.GPS     = GPS;
            bool SetupSuccess = Begin();

            if (!SetupSuccess)
            {
                Log.Output(Log.Severity.WARNING, Log.Source.SENSORS, "BNO055 failed to initialize. Perhaps the sensor is not connected?");
            }
        }
Ejemplo n.º 2
0
 public static async void verificarFuncionamentoGPS()
 {
     if (_gpsServico == null)
     {
         _gpsServico = DependencyService.Get <IGPS>();
     }
     if (!_gpsServico.estaAtivo())
     {
         if (await App.Current.MainPage.DisplayAlert("Sinal de GPS Inativo", "Sinal de GPS não até ativo. Gostaria de ativa-lo?", "Ativar", "Não"))
         {
             _gpsServico.abrirPreferencia();
         }
     }
 }
Ejemplo n.º 3
0
 public void enterPlayerInfo()
 {
     modePlayerInfoBtn.GetComponent <Text>().color   = new Vector4(0, 255, 200, 255);
     modeHasObjectsBtn.GetComponent <Text>().color   = new Vector4(255, 255, 255, 255);
     modeTodayEventBtn.GetComponent <Text>().color   = new Vector4(255, 255, 255, 255);
     modeEventHistoryBtn.GetComponent <Text>().color = new Vector4(255, 255, 255, 255);
     PanelTitle.GetComponent <Text>().text           = "玩家資訊";
     PanelSub.GetComponent <Text>().text             = "目前遊戲: " + PlayerPrefs.GetString("pps" + controller.GetComponent <lifeData>().inSlot + "ttln");
     IGDT.GetComponent <Text>().text    = "遊戲內天數: " + controller.GetComponent <lifeData>().getVal("d");
     IGPT.GetComponent <Text>().text    = "生命值: " + controller.GetComponent <lifeData>().getVal("p");
     IGHT.GetComponent <Text>().text    = "飽食度: " + controller.GetComponent <lifeData>().getVal("u");
     IGWT.GetComponent <Text>().text    = "水分: " + controller.GetComponent <lifeData>().getVal("h");
     IGDS.GetComponent <Slider>().value = controller.GetComponent <lifeData>().getVal("d");
     IGPS.GetComponent <Slider>().value = controller.GetComponent <lifeData>().getVal("p");
     IGHS.GetComponent <Slider>().value = controller.GetComponent <lifeData>().getVal("u");
     IGWS.GetComponent <Slider>().value = controller.GetComponent <lifeData>().getVal("h");
     playerInfoMother.SetActive(true);
     playerHasObjects.SetActive(false);
     playerTodayEvent.SetActive(false);
     playerEventHistory.SetActive(false);
 }
Ejemplo n.º 4
0
 public GPSReader(IGPS gps)
 {
     _gps = gps;
 }