Example #1
0
        private void WeatherDevice_onReceivedMessage(object sender, EventArgs e)
        {
            var receivedMessage = e as ReceivedMessageEventArgs;

            if (receivedMessage != null)
            {
                if (receivedMessage.Message.Name == "CustomDisplay")
                {
                    _displayMode = AlphaNumericDisplayMode.Custom;

                    _display.Display(receivedMessage.Message.MessageId);
                }

                Log.Debug(Tag, "Message Received: " + receivedMessage.ToString());
            }
        }
 public void OnProgressChanged(SeekBar seekBar, int progress, bool fromUser)
 {
     try
     {
         _display.Display(progress);
     }
     catch (IOException ex)
     {
         Log.Error(TAG, "Error display!", ex);
     }
 }
 private void UpdateDisplay(double value)
 {
     try
     {
         _display.Display(value);
     }
     catch (Exception e)
     {
         Log.Error(Tag, "Error setting display", e);
     }
 }
 public void UpdateDisplay(float value)
 {
     if (display != null)
     {
         try
         {
             display.Display(value);
         }
         catch (Exception e)
         {
             Log.Error(TAG, "Error setting display", e);
         }
     }
 }
        private void SetupDemo3()
        {
            _ledBrightnessView = FindViewById <SeekBar>(Resource.Id.ledBrightness);

            try
            {
                _display = RainbowHat.OpenDisplay();
                _display.SetEnabled(true);
                _display.Display("HEY");
            }
            catch (IOException ex)
            {
                Log.Error(TAG, "Error during onCreate!", ex);
            }

            _ledBrightnessView.SetOnSeekBarChangeListener(this);
        }
 private async void UpdateDisplay(float value)
 {
     if (_display != null)
     {
         try
         {
             _display.Display(value);
             _tempValueTxtiew.Text      = _lastTemperature.ToString("##.##");
             _pressureValueTxtView.Text = _lastPressure.ToString("##.##");
             if (!CrossConnectivity.Current.IsConnected)
             {
                 return;
             }
             Initialise();
             await SendDeviceToCloudMessagesAsync(_lastTemperature, _lastPressure);
         }
         catch (Exception e)
         {
             Log.Error(TAG, "Error setting display", e);
         }
     }
 }