Advertisement
Guest User

Untitled

a guest
May 21st, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "mainwindow.h"
  2. #include "ui_mainwindow.h"
  3. #include<wiringPi.h>
  4. MainWindow::MainWindow(QWidget *parent) :
  5.     QMainWindow(parent),
  6.     ui(new Ui::MainWindow)
  7. {
  8.     ui->setupUi(this);
  9.     wiringPiSetup();
  10.     pinMode(0,OUTPUT);
  11.  
  12. }
  13.  
  14. MainWindow::~MainWindow()
  15. {
  16.     delete ui;
  17. }
  18.  
  19. void MainWindow::on_pushButton_clicked()
  20. {
  21.     static bool state=false;
  22.     digitalWrite(0,state);
  23.     state=~state;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement