Body: <p>In my program, I need to detect if a touch sensor is activated. Here's some of my code:</p>
  
  <pre><code>var nxt = new Brick&lt;Sensor, Sensor, Sensor, Sensor&gt;("usb");
  nxt.Connection.Open();
  nxt.Sensor1 = new TouchSensor();
  nxt.Sensor1.Reset(false);
  nxt.Sensor1.Initialize();
  Console.WriteLine(nxt.Sensor1.ReadAsString());
  </code></pre>
  
  <p>But When I run it, the value always displays as zero. But I discovered that if I go into the "View" menu in the NXT and see the touch sensor value, the program value reads 1. I can't do that. Also, don't tell me to use Bluetooth, or get the EV3, because I can't. I've tried using the code from the Monobrick website, still nothing. I've also asked it in the "robotics" section. Can someone help me?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-19T23:02:31.907Z
Comments.Text: This got answered over at http://robotics.stackexchange.com/questions/11599/monobrick-communication-library-reading-nxt-sensors
Comments.UserDisplayName: chicks
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-19T23:03:39.593Z
Comments.Text: I didnt get my problem fixed
Comments.UserDisplayName: jpcreeper13
Tags: <nxt>
Title: Reading NXT Touch Sensor with Monobrick Communication Library
UserDisplayName: jpcreeper13
ThreadText: # Reading NXT Touch Sensor with Monobrick Communication Library
  
  (Asked by: username_0 on 2017-02-18)
  
  In my program, I need to detect if a touch sensor is activated. Here's some of my code:
  
  ```
  var nxt = new Brick<Sensor, Sensor, Sensor, Sensor>("usb");
  nxt.Connection.Open();
  nxt.Sensor1 = new TouchSensor();
  nxt.Sensor1.Reset(false);
  nxt.Sensor1.Initialize();
  Console.WriteLine(nxt.Sensor1.ReadAsString());
  
  ```
  
  But When I run it, the value always displays as zero. But I discovered that if I go into the "View" menu in the NXT and see the touch sensor value, the program value reads 1. I can't do that. Also, don't tell me to use Bluetooth, or get the EV3, because I can't. I've tried using the code from the Monobrick website, still nothing. I've also asked it in the "robotics" section. Can someone help me?
  
  **Tags:** nxt
  
  > **Comments:**
  > **username_1**: This got answered over at http://robotics.stackexchange.com/questions/11599/monobrick-communication-library-reading-nxt-sensors  
  > **username_0**: I didnt get my problem fixed  
  
  ---
  
  ## 0 answers
  
  