title: QThread wiringPi GPIO
body: <p>I use a RaspberryPi and Qt for my  Qt for my embedded Project
  I have read about <code>QThread</code>. I tested <code>QThread</code> and it is working very fine.
  I want to control some GPIO pins in my Thread, but this doesn't work
  My GPIO pins are working, I have tested it.</p>
  
  <p>Here my Code:</p>
  
  <pre><code>class referenz_thread:public QThread
  {
      Q_OBJECT
      public:
          bool x_isRef;
          bool y_isRef;
          void run()
          {
              x_isRef = false;
              y_isRef = false;
  
              digitalWrite(x_treiber,1);
              digitalWrite(y_treiber,1);
              digitalWrite(x_richtung,0);
              digitalWrite(y_richtung,1);
  
              while(1)
              {                
                  if(digitalRead(x_end) == 0)
                  {
                      digitalWrite(x_treiber,0);
                      x_isRef = true;                    
  
                  }
                  if(digitalRead(y_end) == 0)
                  {
                      digitalWrite(y_treiber,0);
                      y_isRef = true;                    
  
                  }
                  if((x_isRef == true) &amp;&amp; (y_isRef == true))
                  {                    
                      break;
                  }
                  digitalWrite(x_v,1);
                  digitalWrite(y_v,1);
                  delay(1);
                  digitalWrite(x_v,0);
                  delay(1);
                  digitalWrite(x_v,1);
                  delay(1);
                  digitalWrite(x_v,0);
                  digitalWrite(y_v,0);
                  delay(1);
              }
           }
      public slots:
  };
  </code></pre>
  
  <p>This is in MainWindow.cpp</p>
  
  <pre><code>referenz_thread *ref_thread = new referenz_thread();
  connect(ui-&gt;btn_ref,SIGNAL(clicked()),ref_thread,SLOT(start()));
  </code></pre>
  
  <p>I have <code>wiringPiSetup</code> already executed in my MainThread.</p>