Exemple #1
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
 }
Exemple #2
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)));
 }
Exemple #3
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)));
 }
Exemple #4
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
     }));
 }