Exemplo n.º 1
0
 /// <summary>
 /// Handle sensor update message from Scribbler
 /// </summary>
 public void SensorNotificationHandler(brick.Replace notify)
 {
     double[] vals = { notify.Body.LineLeft ? 1.0 : 0.0, notify.Body.LineRight ? 1.0 : 0.0 };
     OperationsPort.Post(new vector.SetAllElements(new List<double>(vals)));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Handle sensor update message from Scribbler
 /// </summary>
 public void SensorNotificationHandler(brick.Replace notify)
 {
     double[] values = { (notify.Body.Stall ? 1.0 : 0.0) };
     OperationsPort.Post(new vector.SetAllElements(new List<double>(values)));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Handle sensor update message from Scribbler
 /// </summary>
 public void SensorNotificationHandler(brick.Replace notify)
 {
     OperationsPort.Post(new vector.SetAllElements(new List<double> { notify.Body.LightLeft, notify.Body.LightCenter, notify.Body.LightRight }));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Handle sensor update message from Scribbler
 /// </summary>
 public void SensorNotificationHandler(brick.Replace notify)
 {
     bool[] values = { notify.Body.IRLeft, notify.Body.IRRight };
     OperationsPort.Post(new vector.SetAllElements(new List<double>(
         from v in values
         select (!v ? 1.0 : 0.0)))); // NOTE: v is being inverted here
 }