title: How to store a bit in C#
body: <p>I have the following code:</p>
  
  <pre><code>void MyBitMaker(int inputNumber)
  {
      Console.WriteLine(inputNumber &lt;&lt; 1);
  
      //TODO
      //Bit bitHolder = inputNumber &lt;&lt; 1;
      //InitMico(ref bitHolder);
  }
  </code></pre>
  
  <p>There is not a type for storing bits in <code>C#</code>. Is there any way to store bits in a variable.
  <br />
  I am programming a micro controller using <code>C#</code>, It uses the bits that are coming from a web service, fetches them and sends them to the controller to open, close, sleep and such things using an interface to change the input data to appropriate bits. My problem is that the micro has just 16 bytes memory in ram and I can not store more than two bytes, the micro should store the history of previous actions (this is extra, maybe, jargon). I have low space and need this small unit. I searched a lot and did not find anything. currently I am using bit operators using a class that I myself have implemented but it's not efficient at all because of using bit operations. I was wondering if someone has faced something that can help me.</p>