Пример #1
0
 public void Initialize()
 {
     device = new UnixDevice("/dev/fb0");
     memory = device.MMap((uint)hwBufferSize, 0);
     Clear();
     Update();
 }
Пример #2
0
 public Output()
 {
     pwmDevice     = new UnixDevice("/dev/lms_pwm");
     tachoDevice   = new UnixDevice("/dev/lms_motor");
     tachoMemory   = tachoDevice.MMap(TachoMemorySize, 0);
     this.BitField = OutputBitfield.OutA;
 }
Пример #3
0
        static Lcd()
        {
            var device = new UnixDevice("/dev/fb0");

            memory = device.MMap((uint)hwBufferSize, 0);
            Clear();
            Update();
        }
Пример #4
0
 public I2CSensor(SensorPort port, byte address, I2CMode mode)
 {
     this.port       = port;
     this.I2CAddress = address;
     I2CDevice       = SensorManager.Instance.I2CDevice;
     this.mode       = mode;
     SensorManager.Instance.SetAnalogMode((AnalogMode)mode, port);
 }
Пример #5
0
        private Lcd()
        {
            device = new UnixDevice("/dev/fb0");
            memory = device.MMap(hwBufferSize, 0);
            Clear();
            Update();

            redGradientStep   = (float)(endColor.Red - startColor.Red) / Height;
            greenGradientStep = (float)(endColor.Green - startColor.Green) / Height;
            blueGradientStep  = (float)(endColor.Blue - startColor.Blue) / Height;
        }
Пример #6
0
        private SensorManager()
        {
            DeviceManager = new UnixDevice("/dev/lms_dcm");

            AnalogDevice = new UnixDevice("/dev/lms_analog");
            AnalogMemory = AnalogDevice.MMap(analogMemorySize, 0);

            UartDevice = new UnixDevice("/dev/lms_uart");
            UartMemory = UartDevice.MMap(uartMemorySize, 0);

            I2CDevice = new UnixDevice("/dev/lms_iic");
            I2CMemory = I2CDevice.MMap(i2cMemorySize, 0);
        }
Пример #7
0
        static bool Shutdown(Lcd lcd, Buttons btns)
        {
            var dialog = new QuestionDialog(Font.MediumFont, lcd, btns, "Are you sure?", "Shutdown EV3");

            dialog.Show();
            if (dialog.IsPositiveSelected)
            {
                lcd.Clear();
                lcd.WriteText(font, new Point(0, 0), "Shutting down...", true);
                lcd.Update();

                using (UnixDevice dev = new UnixDevice("/dev/lms_power"))
                {
                    dev.IoCtl(0, new byte[0]);
                }
                btns.LedPattern(2);
                MenuAction = () => ProcessHelper.RunAndWaitForProcess("/lejos/bin/exit");
                return(true);
            }
            return(false);
        }
Пример #8
0
 public UartSensor(SensorPort port)
 {
     this.port  = port;
     uartMemory = SensorManager.Instance.UartMemory;
     UartDevice = SensorManager.Instance.UartDevice;
 }
Пример #9
0
 public EV3Buttons()
 {
     dev       = new UnixDevice("/dev/lms_ui");
     buttonMem = dev.MMap(ButtonCount, 0);
 }
Пример #10
0
 protected Brick()
 {
     this.dev        = new UnixDevice("/dev/lms_analog");
     this.batteryMem = this.dev.MMap(ANALOG_SIZE, 0);
 }