Пример #1
0
        public LidarReader(double setNoVehicle, double sensitivy, double trigger_sensetivity)
        {
            Debug.Print("== LidarReader constructor");
            _sensitivy = sensitivy;
            _minValue  = setNoVehicle * 0.7;
            _noVehicleDistanceRange = _minValue * 3.2; // distance with no vehicle , if we get more than that , we just ignore the value.
            _mLidarStartTime        = 0;
            LidarInitialized        = true;
            _lastTriggerDistance    = 0;
            _triggerSensetivity     = trigger_sensetivity;
            _stoppedVehicleHappened = false;
            _distanceValueLocation  = null;
            _interruptDisableCount  = 0;

            // assign port , but disable interrupts , will be enabled in the start function
            _oport  = new OutputPort(Pins.GPIO_PIN_D2, true);
            _inport = new InterruptPort(Pins.GPIO_PIN_D1, true, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth);


            /*
             * // Manualy set interrupot c**t before
             * lock (_inport)
             * {
             *  _interruptDisableCount++;
             *  _inport.DisableInterrupt();
             *  Debug.Print("lr" + " Disable: " + _interruptDisableCount);
             * }
             */
        }
Пример #2
0
        // private OutputPort led;


        /// <summary>
        /// Creates an NeonMika.Webserver instance running in a seperate thread
        /// </summary>
        /// <param name="portNumber">The port to listen for incoming requests</param>
        public Server()
        {
            // Turn on red Light to show we are initializing
            _statusLED = new StatusLED.StatusLED(Pins.GPIO_PIN_D8, Pins.GPIO_PIN_D9, Pins.GPIO_PIN_D10);
            _statusLED.redLED();
            _laser         = new Laser.Laser(Pins.GPIO_PIN_D4);
            _distanceValue = new DistanceValue.DistanceValueClass();
        }
Пример #3
0
 public void setDistanceValue(DistanceValue.DistanceValueClass dv)
 {
     _distanceValue = dv;
 }
Пример #4
0
 public void setDistanceValue(DistanceValue.DistanceValueClass dv)
 {
     _readLidarResponse.setDistanceValue(dv);
 }
Пример #5
0
 public void setDistanceValue(DistanceValue.DistanceValueClass dv)
 {
 }
Пример #6
0
 public void setDistanceValueLocation(DistanceValue.DistanceValueClass dv)
 {
     _distanceValueLocation = dv;
 }