예제 #1
0
파일: Bumper.cs 프로젝트: yingted/Myro
 /// <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
 }
예제 #2
0
파일: LineSensor.cs 프로젝트: yingted/Myro
 /// <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)));
 }
예제 #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)));
 }
예제 #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
     }));
 }